Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update swagger-codegen-maven-plugin example to use current dependencies #3291

Conversation

hello-josh
Copy link

Fixes #3261
New PR for history vanity

<jersey-version>2.12</jersey-version>
<jackson-version>2.4.2</jackson-version>
<jodatime-version>2.3</jodatime-version>
<swagger-core-version>1.5.8</swagger-core-version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for swagger core, i believe the latest stable version is 1.5.9: https://mvnrepository.com/artifact/io.swagger/swagger-core

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used the output from https://generator.swagger.io/#!/clients/generateClient in order to get the version numbers. That generator API returns 1.5.8 so I copied it in order to stay on par with what was already being done.

I can update it if you think there are no breaking changes between versions.

@wing328
Copy link
Contributor

wing328 commented Jul 6, 2016

generator.swagger.io uses the latest stable version (2.1.6) but not the latest master. After the 2.1.16 release, we've reviewed and updated the dependencies for all langauges so please use 1.5.9 instead for swagger core version.

@wing328
Copy link
Contributor

wing328 commented Jul 6, 2016

cc @ePaul

@hello-josh
Copy link
Author

Where can I find that list in code so I can match it up in the future?

@wing328
Copy link
Contributor

wing328 commented Jul 6, 2016

For Java dependencies, I usually go to https://mvnrespository.com to look for the latest stable version.

e..g https://mvnrepository.com/artifact/io.swagger/swagger-core

@hello-josh
Copy link
Author

I meant which versions you know that the generated templates work with. I
don't want to blindly bump to latest if that doesn't work with the
generated Java files.
On Wed, Jul 6, 2016 at 7:14 AM wing328 notifications@github.com wrote:

For Java dependencies, I usually go to https://mvnrespository.com to look
for the latest stable version.

e..g https://mvnrepository.com/artifact/io.swagger/swagger-core


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#3291 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAm8ebD0Dt6TakfJhYtZUwlU7ygDfqdAks5qS43_gaJpZM4JEs5S
.

@wing328
Copy link
Contributor

wing328 commented Jul 6, 2016

The template should work with the latest stable version. If there's any issues, we definitely need to look into those.

If you do not feel comfortable upgrading swagger core to 1.5.9, it's perfectly to fine to keep 1.5.8 and we'll do the upgrade later.

@hello-josh
Copy link
Author

@wing328 it is building now. It would be nice to have something in the build process to automate these dependency updates so they stay in sync automatically

@wing328
Copy link
Contributor

wing328 commented Jul 6, 2016

@TRII agree that automating the dependency updates would be nice.

For the CI failure, it's due to npm/npm#13284, which has been ongoing for hours...

I'll restart the CI jobs once the issue has been addressed.

@hello-josh hello-josh force-pushed the update-maven-plugin-example-dependencies branch from 3c89f54 to ec6ba1c Compare July 6, 2016 19:25
@wing328
Copy link
Contributor

wing328 commented Jul 7, 2016

There was an issue reported by the CI as follows:

�[0K$ cd modules/swagger-codegen-maven-plugin/examples && mvn -f java-client.xml swagger-codegen:generate
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building sample-project 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- swagger-codegen-maven-plugin:2.2.0-SNAPSHOT:generate (default-cli) @ sample-project ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.902s
[INFO] Finished at: Thu Jul 07 04:06:01 UTC 2016
[INFO] Final Memory: 10M/142M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.swagger:swagger-codegen-maven-plugin:2.2.0-SNAPSHOT:generate (default-cli) on project sample-project: The parameters 'inputSpec', 'language' for goal io.swagger:swagger-codegen-maven-plugin:2.2.0-SNAPSHOT:generate are missing or invalid -> [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/PluginParameterException

@TRII I wonder if you can take a look when you've time.

@wing328 wing328 modified the milestones: v2.3.0, v2.2.0 Jul 9, 2016
@@ -12,7 +12,7 @@
<plugin>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>2.1.5-SNAPSHOT</version>
<version>2.2.0-SNAPSHOT</version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2.2.0 has been released: https://mvnrepository.com/artifact/io.swagger/swagger-codegen-maven-plugin

Please kindly remove the -SNAPSHOT

@wing328
Copy link
Contributor

wing328 commented Jul 20, 2016

@TRII I tested with the latest master and got the same error when running mvn -f java-client.xml swagger-codegen:generate

Does the command run without issue in your local environment?

@hello-josh
Copy link
Author

@wing328 mvn -f java-client.xml swagger-codegen:generate has never worked. The only way I have been able to get it to work was by moving the inputSpec parameter up one level in the java-client.xml as it doesn't seem to process those parameters when running the swagger-codegen:generate goal directly.

@wing328
Copy link
Contributor

wing328 commented Jul 20, 2016

@TRII thanks for the info. Can you please update the java-client.xml as well with the fix? Otherwise, there's no way the CI tests can pass when running the command.

@hello-josh
Copy link
Author

hello-josh commented Jul 20, 2016

@wing328 honestly I quit fighting with it. The code generation library works well but the maven plugin is not quite right. The codegen tool also generates test stubs but the maven plugin does not. I'm not a java developer so fixing this is out of my current skill set. I am writing more java lately, but my deliverables preclude any extra curricular work I can put into this plugin at the moment.

As I get more familiar with how maven plugins work, I can probably come back and revisit this item.

@wing328
Copy link
Contributor

wing328 commented Jul 20, 2016

@TRII thanks again for your time and effort in fixing it. I'll try to get a core team member to address that.

@hello-josh
Copy link
Author

@wing328 I may be able to revisit this in a week or two. I'll keep you updated.

@wing328 wing328 modified the milestones: v2.2.1, v2.3.0 Aug 8, 2016
@wing328 wing328 removed this from the v2.2.1 milestone Aug 8, 2016
@dyeshurun
Copy link

dyeshurun commented Jul 18, 2017

Any update about this? I keep getting the error above (using 2.2.3)
I tried other versions as well - no success

Ah, now I see - if I move to be direct child of the plugin then it works

@frantuma
Copy link
Member

replaced by #8448

@frantuma frantuma closed this Jul 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants