Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark maven plugin goals @threadSafe #178

Merged
merged 2 commits into from Feb 12, 2024
Merged

Conversation

jfallows
Copy link
Contributor

Fix #95.

I have reviewed the code for each moditect plugin goal and it seems as though they use project relative resources only, triggering no conflicts when running in a multi-threaded parallel build.

@aalmiray
Copy link
Contributor

aalmiray commented Feb 12, 2024

What does it mean for a plugin to be marked as threadsafe? The docs don't say much, do they?

AFAICT the add-module-info goal modifies the project's artifact by rewriting it. If another goal works on the same artifact at the same time, then there's no guarantee on the outcome, is there? Similarly, the generate-module-info goal could find itself in a similar position.

I don't think we can mark all ModiTect mojos as threadsafe.

@gunnarmorling
Copy link
Member

gunnarmorling commented Feb 12, 2024

AFAICT the add-module-info goal modifies the project's artifact by rewriting it. If another goal works on the same artifact at the same time, then there's no guarantee on the outcome, is there?

Can this actually happen? IIUC, parallelism in Maven refers to building multiple modules concurrently, but not execute the goals of one module concurrently. I.e. if a plug-in can run safely for different modules at the same time, it should be fine. There's some context here.

@aalmiray
Copy link
Contributor

Gotcha. If parallelism is executed per module as a whole, instead of per goals within a module then I think we're good to go and mark all mojos as threadsafe.

@gunnarmorling
Copy link
Member

Yeah, at least I am not aware of any way for running the goals of one module in parallel.

@gunnarmorling gunnarmorling merged commit e66d794 into moditect:main Feb 12, 2024
1 check passed
@gunnarmorling
Copy link
Member

Merged. Thx, @jfallows!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support multi-threaded Maven builds
4 participants