[BUG] openapi-generator-maven-plugin is not marked as threadSafe
Created by: famod
Description
Building a Maven multimodule project in parallel (e.g. mvn -T2 ...
) that uses openapi-generator-maven-plugin
yields the following warning for each plugin execution:
[2020-04-08T13:59:47.119Z] [WARNING] *****************************************************************
[2020-04-08T13:59:47.119Z] [WARNING] * Your build is requesting parallel execution, but project *
[2020-04-08T13:59:47.119Z] [WARNING] * contains the following plugin(s) that have goals not marked *
[2020-04-08T13:59:47.119Z] [WARNING] * as @threadSafe to support parallel building. *
[2020-04-08T13:59:47.119Z] [WARNING] * While this /may/ work fine, please look for plugin updates *
[2020-04-08T13:59:47.119Z] [WARNING] * and/or request plugins be made thread-safe. *
[2020-04-08T13:59:47.119Z] [WARNING] * If reporting an issue, report it against the plugin in *
[2020-04-08T13:59:47.119Z] [WARNING] * question, not against maven-core *
[2020-04-08T13:59:47.119Z] [WARNING] *****************************************************************
[2020-04-08T13:59:47.119Z] [WARNING] The following plugins are not marked @threadSafe in some-module:
[2020-04-08T13:59:47.119Z] [WARNING] org.openapitools:openapi-generator-maven-plugin:4.2.3
[2020-04-08T13:59:47.119Z] [WARNING] Enable debug to see more precisely which goals are not marked @threadSafe.
[2020-04-08T13:59:47.119Z] [WARNING] *****************************************************************
openapi-generator version
4.2.3
OpenAPI declaration file content or url
not relevant
Command line used for generation
mvn clean install -T2
(example)
Steps to reproduce
Build a multimodule project taht is using openapi-generator-maven-plugin
in parallel.
Related issues/PRs
n/a
Suggest a fix
Add threadSafe=true
to @Mojo
: https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java#L73
This assumes that the plugin does handle concurrent invocations (form different modules) without concurrency issues!