swagger-api / swagger-api/swagger-codegen

[ANY] Maven build fails for client generation and no jar file is created.

Open
#8,989 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

I'm following the Readme file (Getting Started) to generate a PHP client. The following error happens after running mvn clean package

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] swagger-codegen-project 3.0.3 ...................... SUCCESS [  9.209 s]
[INFO] swagger-codegen (core library) ..................... FAILURE [01:08 min]
[INFO] swagger-codegen (executable) ....................... SKIPPED
[INFO] swagger-codegen (maven-plugin) ..................... SKIPPED
[INFO] swagger-generator 3.0.3 ............................ SKIPPED
,
       "summary": "Finds Pets by tags",
       "description": "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------

The swagger-codegen-cli.jar file does not get generated, so running the next command:

java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
  -i http://petstore.swagger.io/v2/swagger.json \
  -l php \
  -o /var/tmp/php_api_client

produces

Error: Unable to access jarfile modules/swagger-codegen-cli/target/swagger-codegen-cli.jar
Swagger-codegen version

ANY

Swagger declaration file content or url

ANY

Command line used for generation
git clone https://github.com/swagger-api/swagger-codegen
cd swagger-codegen
mvn clean package
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
   -i http://petstore.swagger.io/v2/swagger.json \
   -l php \
   -o /var/tmp/php_api_client 
Related issues/PRs

https://github.com/swagger-api/swagger-codegen/issues/8734

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the README Getting Started commands with mvn clean package from the cloned repository. Start with the full failure in the swagger-codegen (core library) module, then compare the report with related issue 8734. Done means the build completes, modules/swagger-codegen-cli/target/swagger-codegen-cli.jar exists, and the documented PHP generation command can run.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, php
Domain
build-system, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.