Swagger-codegen: Build error - My own codegen

Created on 8 Jun 2016  路  10Comments  路  Source: swagger-api/swagger-codegen

Description

I麓m getting an error when I try to build my own codegen. I tried building the project created using
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar meta -o output/myLibrary -n myClientCodegen -p com.my.company.codegen (to check if I might have written something wrong) and I get the same error.
It looks for io.swagger:swagger-codegen:jar:2.2.0-SNAPSHOT at my maven repository, but it isn麓t there.

Command line used for generation

C:\Users\x\Documents\swagger-codegen\output\myLibrary>mvn package -X

Error message
=======================================================================
[DEBUG] Could not find metadata io.swagger:swagger-codegen:2.2.0-SNAPSHOT/maven-metadata.xml in local (C:\Users\lsarni\.m2\repository)
[DEBUG] Could not find metadata io.swagger:swagger-codegen:2.2.0-SNAPSHOT/maven-metadata.xml in local (C:\Users\lsarni\.m2\repository)
[WARNING] The POM for io.swagger:swagger-codegen:jar:2.2.0-SNAPSHOT is missing, no dependency information available
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=1, ConflictMarker.markTime=0, ConflictMarker.nodeCount=2, ConflictIdSorter.graphTime=1, ConflictIdSorter.topsortTime=0, ConflictIdSorter.conflictIdCount=1, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=2, ConflictResolver.conflictItemCount=1, DefaultDependencyCollector.collectTime=5, DefaultDependencyCollector.transformTime=5}
[DEBUG] io.swagger:genexusCodegen-swagger-codegen:jar:1.0.0
[DEBUG]    io.swagger:swagger-codegen:jar:2.2.0-SNAPSHOT:provided
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.247 s
[INFO] Finished at: 2016-06-08T14:37:21-03:00
[INFO] Final Memory: 7M/245M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project genexusCodegen-swagger-codegen: Could not resolve dependencies for project io.swagger:genexusCodegen-swagger-codegen:jar:1.0.0: Could not find artifact io.swagger:swagger-codegen:jar:2.2.0-SNAPSHOT -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project genexusCodegen-swagger-codegen: Could not resolve dependencies for project io.swagger:genexusCodegen-swagger-codegen:jar:1.0.0: Could not find artifact io.swagger:swagger-codegen:jar:2.2.0-SNAPSHOT
        at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:221)
        at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:127)
        at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:245)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:199)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project io.swagger:genexusCodegen-swagger-codegen:jar:1.0.0: Could not find artifact io.swagger:swagger-codegen:jar:2.2.0-SNAPSHOT
        at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:211)
        at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:195)
        ... 23 more
Caused by: org.eclipse.aether.resolution.DependencyResolutionException: Could not find artifact io.swagger:swagger-codegen:jar:2.2.0-SNAPSHOT
        at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:384)
        at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:205)
        ... 24 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not find artifact io.swagger:swagger-codegen:jar:2.2.0-SNAPSHOT
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:444)
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
        at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:367)
        ... 25 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact io.swagger:swagger-codegen:jar:2.2.0-SNAPSHOT
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:434)
        ... 27 more
[ERROR]
[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

Bug

Most helpful comment

I'm having the same issue, however I am running mvn install in the correct directory (also, if mvn install is required it should probably be mentioned in the README.md).

This is what I get:

$ mvn install
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for io.swagger:CSharp_Unity-swagger-codegen:jar:1.0.0
[WARNING] 'build.plugins.plugin.version' for org.codehaus.mojo:build-helper-maven-plugin is missing. @ line 48, column 15
[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] ------------------------------------------------------------------------
[INFO] Building CSharp_Unity-swagger-codegen 1.0.0
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for io.swagger:swagger-codegen:jar:2.2.0-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.144 s
[INFO] Finished at: 2016-07-07T09:57:25-04:00
[INFO] Final Memory: 7M/150M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project CSharp_Unity-swagger-codegen: Could not resolve dependencies for project io.swagger:CSharp_Unity-swagger-codegen:jar:1.0.0: Could not find artifact io.swagger:swagger-codegen:jar:2.2.0-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

All 10 comments

encounter the same issue during running testNG tests. any idea to fix it?

It looks for io.swagger:swagger-codegen:jar:2.2.0-SNAPSHOT at my maven repository, but it isn麓t there.

You will need to run mvn install to install the jar to your local maven repo.

@wing328 i did... but will try again, thanks

Please provide more details such as the exact command you executed and the error message.

@wing328 fixed.. i made a stupid error... i was running mvn install in swagger-codegen/modules/swagger-codegen.

Thanks

@dkmilan np.

@daisymoon let us know if you still need help from us (the community)

@wing328 thanks, I found a way to work around it

I'm having the same issue, however I am running mvn install in the correct directory (also, if mvn install is required it should probably be mentioned in the README.md).

This is what I get:

$ mvn install
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for io.swagger:CSharp_Unity-swagger-codegen:jar:1.0.0
[WARNING] 'build.plugins.plugin.version' for org.codehaus.mojo:build-helper-maven-plugin is missing. @ line 48, column 15
[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] ------------------------------------------------------------------------
[INFO] Building CSharp_Unity-swagger-codegen 1.0.0
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for io.swagger:swagger-codegen:jar:2.2.0-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.144 s
[INFO] Finished at: 2016-07-07T09:57:25-04:00
[INFO] Final Memory: 7M/150M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project CSharp_Unity-swagger-codegen: Could not resolve dependencies for project io.swagger:CSharp_Unity-swagger-codegen:jar:1.0.0: Could not find artifact io.swagger:swagger-codegen:jar:2.2.0-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

Any solution?

Was this page helpful?
0 / 5 - 0 ratings