This is an automated email from the ASF dual-hosted git repository.

mthmulders pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-site.git


The following commit(s) were added to refs/heads/master by this push:
     new 63ce785  [MNG-7051] Add examples of ? prefix in profile activation
63ce785 is described below

commit 63ce7855b4a96fe8716c7efffe12828fda1efa40
Author: Maarten Mulders <[email protected]>
AuthorDate: Fri Jan 8 14:23:10 2021 +0100

    [MNG-7051] Add examples of ? prefix in profile activation
    
    Closes #225.
---
 content/apt/guides/introduction/introduction-to-profiles.apt | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/content/apt/guides/introduction/introduction-to-profiles.apt 
b/content/apt/guides/introduction/introduction-to-profiles.apt
index 3f13707..3706bd5 100644
--- a/content/apt/guides/introduction/introduction-to-profiles.apt
+++ b/content/apt/guides/introduction/introduction-to-profiles.apt
@@ -75,7 +75,7 @@ Introduction to Build Profiles
 
     - a descriptor located in
     {{{/ref/2.2.1/maven-profile/profiles.html}project basedir 
<<<(profiles.xml)>>>}}
-    (unsupported in Maven 3.0: see
+    (no longer supported in Maven 3.0 and above; see
     
{{{https://cwiki.apache.org/confluence/display/MAVEN/Maven+3.x+Compatibility+Notes#Maven3.xCompatibilityNotes-profiles.xml}
 Maven 3 compatibility notes}})
 
 * How can a profile be triggered? How does this vary according to the type of 
profile being used?
@@ -100,9 +100,11 @@ Introduction to Build Profiles
   profile IDs to use. The profile(s) specified in the option
   are activated in addition to any profiles which are activated by their 
activation
   configuration or the <<<\<activeProfiles\>>>> section in <<<settings.xml>>>.
+  From Maven 4 onward, Maven will refuse to activate or deactivate a profile 
that cannot be resolved.
+  To prevent this, prefix the profile identifier with an <<<?>>>, marking it 
as optional:
 
 +---+
-mvn groupId:artifactId:goal -P profile-1,profile-2
+mvn groupId:artifactId:goal -P profile-1,profile-2,?profile-3
 +---+
 
   Profiles can be activated in the Maven settings, via the 
<<<\<activeProfiles\>>>>
@@ -307,7 +309,7 @@ mvn groupId:artifactId:goal -Denvironment=test
   identifier with either the character '!' or '-' as shown below:
   
 +---+
-mvn groupId:artifactId:goal -P !profile-1,!profile-2
+mvn groupId:artifactId:goal -P !profile-1,!profile-2,!?profile-3
 +---+
 
   This can be used to deactivate profiles marked as activeByDefault or 
profiles that would 

Reply via email to