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

swagger-codegen-maven-plugin threadsafe? #6260

Open
dantran opened this issue Aug 8, 2017 · 5 comments · Fixed by #10329
Open

swagger-codegen-maven-plugin threadsafe? #6260

dantran opened this issue Aug 8, 2017 · 5 comments · Fixed by #10329

Comments

@dantran
Copy link
Contributor

dantran commented Aug 8, 2017

This is a request to make maven plugin thread safe in order to take advantage of maven multi threaded build

Swagger-codegen version

2.2.2

@MosheElisha
Copy link
Contributor

Same request for the new io.swagger.codegen.v3:swagger-codegen-maven-plugin.

When running maven with parallel execution (-T / --threads), I get the following warning on the generate goal:

*****************************************************************
* Your build is requesting parallel execution, but project      *
* contains the following plugin(s) that have goals not marked   *
* as @threadSafe to support parallel building.                  *
* While this /may/ work fine, please look for plugin updates    *
* and/or request plugins be made thread-safe.                   *
* If reporting an issue, report it against the plugin in        *
* question, not against maven-core                              *
*****************************************************************
The following plugins are not marked @threadSafe in subscribers-api-server:
io.swagger.codegen.v3:swagger-codegen-maven-plugin:3.0.18
Enable debug to see more precisely which goals are not marked @threadSafe.
*****************************************************************

As far as I can tell, everything is working fine. The only issue is this warning report but it would be nice if this could be fixed.

@gscokart
Copy link

It is not only a problem of error message.

I have a multi module project, with submodules using different config of the plugin. The config of one modules leak into the other one when running in parallel. This break my build (I have different supportingFilesToGenerate and some modules are thus missing some of the required supporting files).

@MosheElisha
Copy link
Contributor

MosheElisha commented Apr 27, 2020

Confirming it is a real issue. When running maven with threads, generation in parallel causes compilation errors in case multiple module are using this plugin.

MosheElisha added a commit to MosheElisha/swagger-codegen that referenced this issue Apr 30, 2020
…ism. This naive approach should be replaced in the future and allow parallel runs to achieve faster build times but this change will at least allow users to run maven with threads and other plugins and modules will run in parallel.
MosheElisha added a commit to MosheElisha/swagger-codegen that referenced this issue Jun 19, 2020
…ism. This naive approach should be replaced in the future and allow parallel runs to achieve faster build times but this change will at least allow users to run maven with threads and other plugins and modules will run in parallel. This approach is also suggested by Apache Maven as a workaround: https://cwiki.apache.org/confluence/display/MAVEN/Parallel+builds+in+Maven+3
@MosheElisha
Copy link
Contributor

I found a fork project https://github.com/OpenAPITools/openapi-generator/ which has an openapi-generator-maven-plugin and it seems this issue was already resolved there.

frantuma added a commit that referenced this issue Jun 24, 2020
Fix #6260 on master by preventing parallelism
@frantuma
Copy link
Member

partial fix implemented in #10329, keeping this ticket open to track full addressing of concurrency in v2 and v3

@frantuma frantuma reopened this Jun 24, 2020
frantuma added a commit that referenced this issue Jun 24, 2020
refs #6260 - Fix #6260 on 3.0.0 by preventing parallelism
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants