Generating Swagger java client using maven from api json

689 views
Skip to first unread message

shivika sharma

unread,
Jul 1, 2015, 11:11:53 AM7/1/15
to swagger-sw...@googlegroups.com
Hi,

I am trying to generate a swagger-java-client stub with the given swagger.json (api) using maven. Please help post the maven (pom.xml) code to generate the code (apis, model)with input json at a particular location.

-Shivika

Ole Lensmar

unread,
Jul 1, 2015, 11:15:19 AM7/1/15
to swagger-sw...@googlegroups.com
Hi Shivika,

If you build codegen from the develop_2.0 branch you can use the newly contributed maven-codegen-plugin as described at https://github.com/swagger-api/swagger-codegen/tree/develop_2.0/modules/swagger-codegen-maven-plugin

Good Luck!

/Ole

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

shivika sharma

unread,
Jul 2, 2015, 6:57:04 AM7/2/15
to swagger-sw...@googlegroups.com
Hi Ole

Thanks for response but when i use plugin it gives Could not find artifact com.garethevans.plugin:swagger-codegen-maven-plugin:pom:0.0.1-SNAPSHOT
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.

Ole Lensmar

unread,
Jul 2, 2015, 7:03:11 AM7/2/15
to swagger-sw...@googlegroups.com
Hi Shivika,

you’ll need to pull the develop_2.0 branch from codegen and build it locally for now (mvn install) - we haven’t pushed any version of the maven plugin to maven central yet…

See the readme at https://github.com/swagger-api/swagger-codegen/blob/develop_2.0/modules/swagger-codegen-maven-plugin/README.md for a sample config (you seem to using the wrong groupId/artifactId)

Thanks,

/Ole

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages