juulhobert opened a new issue, #11409:
URL: https://github.com/apache/maven/issues/11409

   ### 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:
   
   
https://github.com/apache/maven/blob/9b95526182ed2be5e72b191308896aebf0ff73b2/impl/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java#L718


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to