graphql-java-generator / graphql-maven-plugin-project

graphql-maven-plugin is a Maven Plugin for GraphQL, based on graphql-java. It accelerates the development for both the client and the server, by generating the Java code. It allows a quicker development when in contract-first approach, by avoiding to code the boilerplate code.
https://graphql-maven-plugin-project.graphql-java-generator.com
MIT License
115 stars 47 forks source link

Declare plugin thread safe #208

Closed cyrilc-pro closed 3 weeks ago

cyrilc-pro commented 5 months ago

When using Maven parallel builds, Maven reports the following warning:

[WARNING] *****************************************************************
[WARNING] * Your build is requesting parallel execution, but this         *
[WARNING] * project contains the following plugin(s) that have goals not  *
[WARNING] * marked as thread-safe to support parallel execution.          *
[WARNING] * While this /may/ work fine, please look for plugin updates    *
[WARNING] * and/or request plugins be made thread-safe.                   *
[WARNING] * If reporting an issue, report it against the plugin in        *
[WARNING] *****************************************************************
[WARNING] The following plugins are not marked as thread-safe in .....:
[WARNING]   com.graphql-java-generator:graphql-maven-plugin:1.18.12
[WARNING]
[WARNING] Enable debug to see precisely which goals are not marked as thread-safe.
[WARNING] *****************************************************************

(Note: I'm using plugin 1.18.12 because I'm stuck with an old Spring Boot version.)

My guess is that the plugin is actually thread-safe and just needs to be declared as thread-safe.

See example here: https://github.com/quarkusio/quarkus/issues/27596

etienne-sf commented 5 months ago

Hello,

Yes, marking a plugin as thread safe is quite easy. But insuring it to be thread safe is really complex : the plugin uses several libraries, which themselves use libraries... I have no way to guaranty that all these dependencies are thread safe. BTW, after a quick check, I see nothing that could cause threading issues.

How important is it for you ?

Etienne

cyrilc-pro commented 5 months ago

It is definitely not a blocker (for me, it works, but I have only one module that generates GraphQL among other modules, all built in parallel). I'm aware of the complexity of thread-safety checks. I guess that you might just acknowledge that the plugin "must" be thread-safe, mark it as such, and then, if one day someone finds an issue with parallel builds, you'll "just" process it as any other issue (fix it or not). You could even rollback the adoption of the thread-safety flag ;)

etienne-sf commented 3 weeks ago

Done in release 2.6