Skip to content

[maven-4.0.x] concurrent/MojoExecutor disables all project-level locking #12586

Description

@elharo

concurrent/MojoExecutor disables all project-level locking

Found in: maven-4.0.x branch
File: impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/concurrent/MojoExecutor.java (lines 38-40)
Severity: Critical

Description

The @Named("concurrent") MojoExecutor subclass (used for parallel builds) disables all project-level locking:

@Override
protected boolean useProjectLock(MavenSession session) {
    return false;  // Always returns false
}

The parent class's useProjectLock() returns true when degreeOfConcurrency > 1 (the concurrent build scenario). By always returning false, this subclass allows multiple mojos to execute concurrently on the same project, which can corrupt shared project state such as artifact filters, dependency resolution state, and plugin configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions