Repository navigation
Conversation
…ernal asymmetry The previous documentation conflated two different suppression behaviors: - POM activeByDefault profiles: suppressed by any profile activation in the same POM, whether via -P or a condition activator (file, property, JDK, OS). - External activeByDefault profiles (settings.xml): suppressed only by an explicit -P / --activate-profiles request. Condition-based POM profile activation does NOT suppress them. This asymmetry is intentional: external profiles typically carry environment config (repositories, credentials) that should remain active regardless of which POM build-variant profile the environment triggers. Also clarify in the 'Profiles activated by default' intro section that the cross-boundary asymmetry exists and point readers to the detailed subsection. Relates to: apache/maven#8488 (MNG-6787)
| The suppression behavior differs depending on where the profile is defined: | ||
|
|
||
| - **POM profiles** (`pom.xml`): an `activeByDefault` profile is suppressed as soon as any other profile in the same POM becomes active, whether via explicit `-P` or via a condition activator (file, property, JDK, OS). | ||
| - **External profiles** (`settings.xml`): an `activeByDefault` profile is only suppressed when another profile is explicitly requested via `-P` / `--activate-profiles`. A condition-based POM profile activating does **not** suppress external `activeByDefault` profiles. This asymmetry is intentional: external profiles typically carry environment configuration (repositories, credentials) that should remain active regardless of which build-variant POM profile is triggered by the environment. |
Member
There was a problem hiding this comment.
As I know profile defined in settings.xml with activeByDefault are not deactivated in any condition.
Contributor
There was a problem hiding this comment.
@gnodet Could you take a look at this comment and check if it needs to be updated. Thank you.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improves the
introduction-to-profilesguide to accurately document theactiveByDefaultsuppression behavior, including the intentional asymmetry between POM and external (settings.xml) profiles introduced by the fix in apache/maven#13254.Changes
"Profiles activated by default" intro section
The previous single sentence described POM-only behavior and was technically inaccurate (it said "activated using one of the previously described methods" without distinguishing -P vs condition activation). Now:
activeByDefaultprofilessettings.xmlbehave differently and points readers to the subsection"Active by default" subsection
The previous text said this flag is "only evaluated if no other profile is explicitly activated via command line,
settings.xmlor activated through some other activator" — which was both inaccurate and incomplete. Now replaced with a clear bullet breakdown:Related