You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Tarun4201 (via GitHub)" <gi...@apache.org> on 2026/09/23 17:30:09 UTC

Re: [I] [MNG-6787] default profile not deactivated when -P specified [maven]

Tarun4201 commented on issue #8488:
URL: https://github.com/apache/maven/issues/8488#issuecomment-5799640208

   I have investigated this bug and submitted a fix in PR https://github.com/apache/maven/pull/13254
   
   **Root Cause:**
   In `DefaultProfileSelector.getActiveProfiles()`, the `activeByDefault` suppression logic only guarded **POM-sourced** profiles. External profiles (e.g. from `settings.xml`) with `activeByDefault=true` were unconditionally appended to the active set, even when the user explicitly requested a different profile via `-P`.
   
   **Fix:**
   External `activeByDefault` profiles are now deferred into a separate list (`activeExternalProfilesByDefault`) and only merged when **no** profile was explicitly activated via `-P`, mirroring the existing pattern already in place for POM profiles. This correctly implements Maven's documented behaviour: all `activeByDefault` profiles are suppressed whenever any profile is explicitly activated.


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org