question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

make the plugin threadSafe

See original GitHub issue

hi, when using maven to build multiple projects, you can ask to run the build in parallel by -TX when X is the number of threads.

when a plugin is not thread-safe the build will take more time to run. from maven build output:

[WARNING] * Your build is requesting parallel execution, but project      *
[WARNING] * contains the following plugin(s) that are not marked as       *
[WARNING] * @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 MyProject:
[WARNING] com.github.eirslett:frontend-maven-plugin:0.0.20
[WARNING] *****************************************************************

is frontend-maven-plugin thread-safe? seems like marking a plugin as thread-safe is easy. can we do that?

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
mtraynhamcommented, Apr 14, 2017

I’ve been getting this warning since 1.5 as well.

Personally, I think we should mark all plugins as threadSafe, even the Yarn goal. What Maven means by “thread safe” here implies that the plugin goal can be run concurrently on multiple modules (i.e. directories). This is not necessarily a problem with single modules as all goals still run synchronously within that module.

It’s usually ok to have two submodule Gulp/Grunt processes running at the same time, as long as they are acting on different modules and not influencing each other. On the contrary, it’s not ok to have multiple Yarn processes running at the same time as the Yarn cache could be altered for one project and have effect on another. There is a Yarn workaround, which is to use a mutex file as suggested here.

Because it’s up to the user to run concurrently with the -T flag, and there is a Yarn workaround, I would suggest just marking all goals as threadSafe.

#466 is strange because two maven modules are sharing node/npm installs, which seems somewhat counter productive to Maven which silo’s modules by nature.

0reactions
mriehemacommented, Apr 11, 2017

Yes please and feel free to open a pull request with a fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to mark maven plugin threadSafe - Stack Overflow
I want to mark maven-clean-plugin as threadsafe using @threadSafe annotation. could anybody give an example? ... From the maven documentation, I ...
Read more >
[#MDEP-287] Make maven-dependency-plugin @threadSafe
Make maven-dependency-plugin @threadSafe. Status: Assignee: Priority: Resolution: ... Description. The plugin is not yet marked as @threadSafe.
Read more >
Thread Safety in Plug-ins | Apple Developer Documentation
If you need to mutate data in your plug-in, you can safely do so by having each thread create its own copy of...
Read more >
Plugin configuration and thread safety - Microsoft Dynamics ...
it seems to be thread safe to have these variables, as long as their values are not changed during some plugin step. In...
Read more >
The following plugins are not marked @threadSafe in project ...
And this is actually working fine, we verified with logs and even a real stopwatch, -T 10 will build faster. Unfortunately, during the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found