I have read about maven parallel build configuration in this. So how I can display all non thread safe plugins? Is there something like "plugin-not-safe-list" command in maven?
REM something like that to display all p[lugins without @threadSafe annotation
mvn help:plugin-not-safe-list
You can write custom rule for maven-enforcer-plugin and use it for running on your maven project.
You might also want to use the mojo-executor to parse the
plugin.xmlfile for checking its "thread safe" property.A little elaboration on when and why you should use the above. When you are working in CI/CD environment, and you want to employ the parallel compilation via maven, you should constantly monitor that your developers are not adding non-thread safe plugins, in order to ensure the consistency and correctness of the CI/CD. In order to achieve that, you can use the above mentioned maven-envorcer-plugin with custom rule. Your custom rule can use the Maven Plugin API (maven project, etc.) in order to search all the plugins in the projects, and then use the mojo-executor lib in order to read the
threadSafeproperty of each plugin (since the maven API does not provide that). mojo-executor lib has tools to parse theplugin.xmlfile of a maven plugin where thethreadSafeproperty resides. Once found, you can fail the maven build.If you want to see only the list of the non-thread safe plugins, you can use the same technique, and just list the plugins which
threadSafeproperty is false. You can then configure themaven-enforcer-pluginto use the custom rule (for example, a profile of the project), and run it via command line in a single maven command.BTW, what happens when you find a non-thread safe plugin in your development project, and there are no thread safe alternatives, is another question, which is also solvable.