swagger-api / swagger-api/swagger-codegen

Can't create custom generator(io.swagger:swagger-codegen:jar:2.4.14-SNAPSHOT is missing)

Open
#10,211 3 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

I downloaded the swagger:

git clone https://github.com/swagger-api/swagger-codegen
cd swagger-codegen
mvn clean package

After, I created my custom generator:

java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar meta \
  -o out/generators/my-codegen -n my-codegen -p com.my.company.codegen

(https://openapi-generator.tech/docs/customization/)

But when I compile it, 𝗜 get an error:

mvn package
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for io.swagger:my-codegen-swagger-codegen:jar:1.0.0
[WARNING] 'build.plugins.plugin.version' for org.codehaus.mojo:build-helper-maven-plugin is missing. @ line 65, column 21
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO] 
[INFO] ---------------< io.swagger:my-codegen-swagger-codegen >----------------
[INFO] Building my-codegen-swagger-codegen 1.0.0
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for io.swagger:swagger-codegen:jar:2.4.14-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.320 s
[INFO] Finished at: 2020-04-27T22:55:23+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project my-codegen-swagger-codegen: Could not resolve dependencies for project io.swagger:my-codegen-swagger-codegen:jar:1.0.0: Could not find artifact io.swagger:swagger-codegen:jar:2.4.14-SNAPSHOT -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

In pom.xml I found:

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <swagger-codegen-version>2.4.14-SNAPSHOT</swagger-codegen-version>
    <maven-plugin-version>1.0.0</maven-plugin-version>
    <junit-version>4.8.1</junit-version>
</properties>

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

Start with the generated out/generators/my-codegen/pom.xml and the repository's pom.xml, especially the swagger-codegen-version property. Reproduce the dependency-resolution failure with mvn package and inspect how the custom generator is expected to reference the locally built project. Done means the generated custom generator builds without the missing-artifact error.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.