swagger-api / swagger-codegen

swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
http://swagger.io
Apache License 2.0
16.97k stars 6.04k forks source link

[Maven] Error building swagger-codegen: swagger-parser 1.0.24 is not available at maven central. #4154

Closed sreeshas closed 7 years ago

sreeshas commented 7 years ago

I'm trying to build swagger-codegen by cloning it on my local machine. I tried run mvn package and build fails. swagger-parser 1.0.24-SNAPSHOT and swagger-compat-spec-parser 1.0.24 SNAPSHOT dependencies are not available from maven central.

Version: 2.2.2 SNAPSHOT

Swagger declaration file content or url
Command line used for generation

mvn package

Steps to reproduce

git clone swagger-codegen mvn package.

Suggest a Fix

Either add swagger-parser 1.0.24 to maven central or change it back to previous version available at maven central. https://github.com/swagger-api/swagger-codegen/blob/master/pom.xml#L810

[INFO] ------------------------------------------------------------------------ [INFO] Building swagger-codegen (core library) 2.2.2-SNAPSHOT [INFO] ------------------------------------------------------------------------ [WARNING] The POM for io.swagger:swagger-parser:jar:1.0.24-SNAPSHOT is missing, no dependency information available [WARNING] The POM for io.swagger:swagger-compat-spec-parser:jar:1.0.24-SNAPSHOT is missing, no dependency information available [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] swagger-codegen-project ........................... SUCCESS [1.646s] [INFO] swagger-codegen (core library) .................... FAILURE [0.186s] [INFO] swagger-codegen (executable) ...................... SKIPPED [INFO] swagger-codegen (maven-plugin) .................... SKIPPED [INFO] swagger-generator ................................. SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.171s [INFO] Finished at: Mon Nov 07 14:16:50 PST 2016 [INFO] Final Memory: 18M/619M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal on project swagger-codegen: Could not resolve dependencies for project io.swagger:swagger-codegen:jar:2.2.2-SNAPSHOT: The following artifacts could not be resolved: io.swagger:swagger-parser:jar:1.0.24-SNAPSHOT, io.swagger:swagger-compat-spec-parser:jar:1.0.24-SNAPSHOT: Failure to find io.swagger:swagger-parser:jar:1.0.24-SNAPSHOT in internal repo was cached in the local repository, resolution will not be reattempted until the update interval of Internal-maven-repo has elapsed or updates are forced -> [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

fehguy commented 7 years ago

Please add this:

    <repositories>
        <repository>
            <id>sonatype-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

to your POM.xml. I'll get that pushed to master shortly.

sreeshas commented 7 years ago

@fehguy ^ Its already present in pom.xml https://github.com/swagger-api/swagger-codegen/blob/master/pom.xml#L801

wing328 commented 7 years ago

If it's still an issue, please reply to let us know.

Closing for the time being.

sreeshas commented 7 years ago

Works as expected.

maneeshsahu commented 7 years ago

Seeing this problem since 12/20. I see that the swagger-parser has been bumped to 1.0.25-SNAPSHOT, but the references to 1.0.24-SNAPSHOT remain.

https://oss.sonatype.org/content/repositories/snapshots/io/swagger/swagger-parser/

fehguy commented 7 years ago

@maneeshsahu please give it a whirl from master. This has updates to the latest parser, core, etc.