You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Guillaume Nodet (Jira)" <ji...@apache.org> on 2025/01/28 09:44:00 UTC
[jira] [Commented] (MNG-7623) Specify if a project can run in parallel
[ https://issues.apache.org/jira/browse/MNG-7623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17921663#comment-17921663 ]
Guillaume Nodet commented on MNG-7623:
--------------------------------------
Maven 4 mojos are expected to be thread-safe and allow concurrency.
Junit has nice features around that, see [https://junit.org/junit5/docs/current/api/org.junit.platform.engine/org/junit/platform/engine/support/hierarchical/ExclusiveResource.html]
I think we could add a new similar annotation that would allow more fine grained exclusiveness. It may need to actually be configured in the POM rather than in the Mojo. For example, we could imagine not being able to run integration tests concurrently. However, it may be hard to mix different levels (mojos and individual tests).
> Specify if a project can run in parallel
> ----------------------------------------
>
> Key: MNG-7623
> URL: https://issues.apache.org/jira/browse/MNG-7623
> Project: Maven
> Issue Type: Improvement
> Reporter: Christoph Läubrich
> Priority: Major
>
> It would be great if one can specify in the pom if a project is safe to execute in parallel.
> I sometimes have a multi-module project where most of the module can run easily in parallel but some needs serial execution, currently using some "hacks" to enforce this.
> This should work the following way:
> # If all projects are marked as "parallel" all works like today (default)
> # If a project is marked as not run in parallel, first execute all projects in the build order until this project
> # Then execute the serial one and proceed with the same (that is execute all in parallel until the next serial project is found)
> This could happen on different level, e.g. such a strategy might be delegated to the builder, or the code that calling the builder can "slice" the projects in the given way and call the builder multiple times.
> Nerveless this will require some change to the project-model to mark a project as parallel, or one might be able to use a project-session-property or alike.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)