code54 / buildversion-plugin

A maven plugin that extracts current build information from git projects
34 stars 9 forks source link

Mark plugin as thread safe for parallel execution in maven 3.x #8

Open dzwicker opened 11 years ago

dzwicker commented 11 years ago

INFO] Building Risk Opportunity Map Application 1.0.0.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [WARNING] [WARNING] * Your build is requesting parallel execution, but project [WARNING] * contains the following plugin(s) that have goals not marked [WARNING] * as @threadSafe to support parallel building. [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] * question, not against maven-core [WARNING] * [WARNING] The following plugins are not marked @threadSafe in Risk Opportunity Map Application: [WARNING] com.code54.mojo:buildversion-plugin:1.0.3 [WARNING] Enable debug to see more precisely which goals are not marked @threadSafe. [WARNING] *****

dzwicker commented 10 years ago

Any reaction would be nice. Is the Mojo thread safe? Or is there something that would break in a parallel execution?

dobladez commented 10 years ago

Any patch would be even nicer ;-). Kidding...

The plugin is indeed thread-safe AFAIK: it has no state, and it invokes git only for read-only operations (git log basically).

Now, as funny as it might seam, marking it as "threadSafe" is not trivial due to the way the "Clojure mojo descriptor extractor" works: it does not recognize threadSafe and it must be modified upstream in other to do so. Unfortunately, I currently don't have the time to fix the "extractor" upstream and get the change accepted and published. I might do it some day.

As an ugly workaround, I guess I could simply modify the generated plugin.xml and re-publish it :-. I would hate to do that though.

adamretter commented 5 years ago

For reference the upstream source for the clojure-maven-mojo-descriptor-extractor can be found here: https://github.com/pallet/clojure-maven/tree/develop/mojo-descriptor-extractor