-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Affected version
4.0.0-rc4
Bug description
When running the help:active-profiles goal in a multi-module project, Maven 4.0.0-rc produces incorrect output compared to Maven 3.9.11. Profiles activated in the parent POM are incorrectly reported as active because of the source: current (sub)project. Maven 3.9.11 correctly reports the source.
A minimal reproducer is available here: https://github.com/juulhobert/active-profiles-reproducer
Maven 3.9.11 output (./mvnw.cmd help:active-profiles)
[INFO] Scanning for projects...
[INFO]
[INFO] ----------< tech.juuls:active-profiles-reproducer-subproject >----------
[INFO] Building active-profiles-reproducer-subproject 1.0-SNAPSHOT
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- help:3.5.1:active-profiles (default-cli) @ active-profiles-reproducer-subproject ---
[INFO]
Active Profiles for Project 'tech.juuls:active-profiles-reproducer-subproject:jar:1.0-SNAPSHOT':
The following profiles are active:
- active-profiles-reproducer (source: tech.juuls:active-profiles-reproducer:1.0-SNAPSHOT)
- subproject-child (source: tech.juuls:active-profiles-reproducer-subproject:1.0-SNAPSHOT)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.713 s
[INFO] Finished at: 2025-11-07T15:33:12+01:00
[INFO] ------------------------------------------------------------------------
Maven 4.0.0-rc4 output (./mvnw.cmd help:active-profiles)
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------------------< tech.juuls:active-profiles-reproducer-subproject >-----------------------------------
[INFO] Building active-profiles-reproducer-subproject 1.0-SNAPSHOT
[INFO] from pom.xml
[INFO] ---------------------------------------------------------[ jar ]----------------------------------------------------------
[INFO]
[INFO] --- help:3.5.1:active-profiles (default-cli) @ active-profiles-reproducer-subproject ---
[INFO]
Active Profiles for Project 'tech.juuls:active-profiles-reproducer-subproject:jar:1.0-SNAPSHOT':
The following profiles are active:
- active-profiles-reproducer (source: tech.juuls:active-profiles-reproducer-subproject:jar:1.0-SNAPSHOT)
- subproject-child (source: tech.juuls:active-profiles-reproducer-subproject:jar:1.0-SNAPSHOT)
[INFO] --------------------------------------------------------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] --------------------------------------------------------------------------------------------------------------------------
[INFO] Total time: 1.527 s
[INFO] Finished at: 2025-11-07T15:32:29+01:00
[INFO] --------------------------------------------------------------------------------------------------------------------------
Suspected cause
The issue may be caused by the use of the effective model on this line:
maven/impl/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java
Line 718 in 9b95526
| result.getEffectiveModel().getId(), getProfileIds(result.getActivePomProfiles())); |
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working