You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Barnabas Bodnar (JIRA)" <ji...@codehaus.org> on 2010/01/04 18:56:55 UTC

[jira] Created: (MNG-4516) Contradiction between the documentation and Maven's behavior related to profile-activation with multiple criteria

Contradiction between the documentation and Maven's behavior related to profile-activation with multiple criteria
-----------------------------------------------------------------------------------------------------------------

                 Key: MNG-4516
                 URL: http://jira.codehaus.org/browse/MNG-4516
             Project: Maven 2 & 3
          Issue Type: Bug
          Components: Profiles
    Affects Versions: 2.2.1
            Reporter: Barnabas Bodnar
            Priority: Critical
         Attachments: debug_output.txt, output.txt, pom.xml

The chapter 5.3.1 of the Maven Complete Reference (edition 0.2.1, Novemeber 2009) speaks unambiguously about considering a logical "AND" between more activation-conditions of a profile (cit.: "A profile is activated when all activation criteria has been satisfied. For example, a profile could list an Operating System family of Windows, and a JDK version of 1.4, this profile will only be activated when the build is executed on a Windows machine running Java 1.4."). 
Suprisingly, Maven's real behavior suggests, that the logical "OR" operator is used. The attached demo project contains a profile with two activation-criteria: a property and the existence of a file. As the output shows (attachement output.txt), the fulfillment of a single criterion is enough for activating the profile. Also the corresponding implementation in the Maven core expresses the intention to use an "OR" logic (maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java r813685 (branch 2.2.x), line 268):

for ( Iterator activatorIterator = activators.iterator(); activatorIterator.hasNext(); )
{
    ProfileActivator activator = (ProfileActivator) activatorIterator.next();

    if ( activator.canDetermineActivation( profile ) )
    {
        if ( activator.isActive( profile ) )
        {
            return true;
        }
    }
}

return false;


As I'm considering the documentation's variant more reasonable, I'm reporting this as a bug instead of a documentation-issue.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MNG-4516) Contradiction between the documentation and Maven's behavior related to profile-activation with multiple criteria

Posted by "Barnabas Bodnar (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-4516?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Barnabas Bodnar updated MNG-4516:
---------------------------------

    Attachment: example2.zip

I have provided another example (example2.zip), analogue to that mentioned in the chapter 5.3.1 of the Maven Complete Reference. The profile-activation is conditioned by two critera: the operating-system family Windows and JDK version 1.5:
{noformat}
      <activation>
          <os>
              <family>windows</family>
          </os>
          <jdk>1.5</jdk>
      </activation>
{noformat} 
By the documentation, it is expected that the profile will *only be activated when the build is executed on a Windows machine running Java 1.5*. 
However, executing the build under Windows with *JDK 1.6* already leads to the activation of the profile (see example2.zip#output_windows_jdk16.txt), similarly to executing the build under *Linux* with JDK 1.5 (see example2.zip#output_linux_jdk15.txt). Consequently, *one single criterion* was enough for activating the profile, in contrast to the behavior described in the documentation ("A profile is activated when *all activation criteria* has been satisfied.").

Is the actual behavior the intended one and the documentation erroneous, or inversely?


> Contradiction between the documentation and Maven's behavior related to profile-activation with multiple criteria
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-4516
>                 URL: http://jira.codehaus.org/browse/MNG-4516
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Profiles
>    Affects Versions: 2.2.1
>            Reporter: Barnabas Bodnar
>            Priority: Critical
>         Attachments: debug_output.txt, example2.zip, output.txt, pom.xml
>
>
> The chapter 5.3.1 of the Maven Complete Reference (edition 0.2.1, Novemeber 2009) speaks unambiguously about considering a logical "AND" between more activation-conditions of a profile (cit.: "A profile is activated when all activation criteria has been satisfied. For example, a profile could list an Operating System family of Windows, and a JDK version of 1.4, this profile will only be activated when the build is executed on a Windows machine running Java 1.4."). 
> Suprisingly, Maven's real behavior suggests, that the logical "OR" operator is used. The attached demo project contains a profile with two activation-criteria: a property and the existence of a file. As the output shows (attachement output.txt), the fulfillment of a single criterion is enough for activating the profile. Also the corresponding implementation in the Maven core expresses the intention to use an "OR" logic (maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java r813685 (branch 2.2.x), line 268):
> for ( Iterator activatorIterator = activators.iterator(); activatorIterator.hasNext(); )
> {
>     ProfileActivator activator = (ProfileActivator) activatorIterator.next();
>     if ( activator.canDetermineActivation( profile ) )
>     {
>         if ( activator.isActive( profile ) )
>         {
>             return true;
>         }
>     }
> }
> return false;
> As I'm considering the documentation's variant more reasonable, I'm reporting this as a bug instead of a documentation-issue.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNG-4516) Contradiction between the documentation and Maven's behavior related to profile-activation with multiple criteria

Posted by "Barnabas Bodnar (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-4516?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=205053#action_205053 ] 

Barnabas Bodnar commented on MNG-4516:
--------------------------------------

In my example-project I didn't use any variable (except the local ones in the Ant-part). Besides, what should of effect have the interpolation onto the logical relation between the activation criteria?



> Contradiction between the documentation and Maven's behavior related to profile-activation with multiple criteria
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-4516
>                 URL: http://jira.codehaus.org/browse/MNG-4516
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Profiles
>    Affects Versions: 2.2.1
>            Reporter: Barnabas Bodnar
>            Priority: Critical
>         Attachments: debug_output.txt, output.txt, pom.xml
>
>
> The chapter 5.3.1 of the Maven Complete Reference (edition 0.2.1, Novemeber 2009) speaks unambiguously about considering a logical "AND" between more activation-conditions of a profile (cit.: "A profile is activated when all activation criteria has been satisfied. For example, a profile could list an Operating System family of Windows, and a JDK version of 1.4, this profile will only be activated when the build is executed on a Windows machine running Java 1.4."). 
> Suprisingly, Maven's real behavior suggests, that the logical "OR" operator is used. The attached demo project contains a profile with two activation-criteria: a property and the existence of a file. As the output shows (attachement output.txt), the fulfillment of a single criterion is enough for activating the profile. Also the corresponding implementation in the Maven core expresses the intention to use an "OR" logic (maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java r813685 (branch 2.2.x), line 268):
> for ( Iterator activatorIterator = activators.iterator(); activatorIterator.hasNext(); )
> {
>     ProfileActivator activator = (ProfileActivator) activatorIterator.next();
>     if ( activator.canDetermineActivation( profile ) )
>     {
>         if ( activator.isActive( profile ) )
>         {
>             return true;
>         }
>     }
> }
> return false;
> As I'm considering the documentation's variant more reasonable, I'm reporting this as a bug instead of a documentation-issue.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MNG-4516) Contradiction between the documentation and Maven's behavior related to profile-activation with multiple criteria

Posted by "Barnabas Bodnar (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-4516?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=205053#action_205053 ] 

Barnabas Bodnar edited comment on MNG-4516 at 1/4/10 1:25 PM:
--------------------------------------------------------------

In my example-project I didn't use variables (except the project-name and local ones in the Ant-part). Besides, what should of effect have the interpolation onto the logical relation between the activation criteria?



      was (Author: bbodnar):
    In my example-project I didn't use variable (except the project-name and local ones in the Ant-part). Besides, what should of effect have the interpolation onto the logical relation between the activation criteria?


  
> Contradiction between the documentation and Maven's behavior related to profile-activation with multiple criteria
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-4516
>                 URL: http://jira.codehaus.org/browse/MNG-4516
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Profiles
>    Affects Versions: 2.2.1
>            Reporter: Barnabas Bodnar
>            Priority: Critical
>         Attachments: debug_output.txt, output.txt, pom.xml
>
>
> The chapter 5.3.1 of the Maven Complete Reference (edition 0.2.1, Novemeber 2009) speaks unambiguously about considering a logical "AND" between more activation-conditions of a profile (cit.: "A profile is activated when all activation criteria has been satisfied. For example, a profile could list an Operating System family of Windows, and a JDK version of 1.4, this profile will only be activated when the build is executed on a Windows machine running Java 1.4."). 
> Suprisingly, Maven's real behavior suggests, that the logical "OR" operator is used. The attached demo project contains a profile with two activation-criteria: a property and the existence of a file. As the output shows (attachement output.txt), the fulfillment of a single criterion is enough for activating the profile. Also the corresponding implementation in the Maven core expresses the intention to use an "OR" logic (maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java r813685 (branch 2.2.x), line 268):
> for ( Iterator activatorIterator = activators.iterator(); activatorIterator.hasNext(); )
> {
>     ProfileActivator activator = (ProfileActivator) activatorIterator.next();
>     if ( activator.canDetermineActivation( profile ) )
>     {
>         if ( activator.isActive( profile ) )
>         {
>             return true;
>         }
>     }
> }
> return false;
> As I'm considering the documentation's variant more reasonable, I'm reporting this as a bug instead of a documentation-issue.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MNG-4516) Contradiction between the documentation and Maven's behavior related to profile-activation with multiple criteria

Posted by "Barnabas Bodnar (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-4516?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=205053#action_205053 ] 

Barnabas Bodnar edited comment on MNG-4516 at 1/4/10 1:24 PM:
--------------------------------------------------------------

In my example-project I didn't use variable (except the project-name and local ones in the Ant-part). Besides, what should of effect have the interpolation onto the logical relation between the activation criteria?



      was (Author: bbodnar):
    In my example-project I didn't use any variable (except the local ones in the Ant-part). Besides, what should of effect have the interpolation onto the logical relation between the activation criteria?


  
> Contradiction between the documentation and Maven's behavior related to profile-activation with multiple criteria
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-4516
>                 URL: http://jira.codehaus.org/browse/MNG-4516
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Profiles
>    Affects Versions: 2.2.1
>            Reporter: Barnabas Bodnar
>            Priority: Critical
>         Attachments: debug_output.txt, output.txt, pom.xml
>
>
> The chapter 5.3.1 of the Maven Complete Reference (edition 0.2.1, Novemeber 2009) speaks unambiguously about considering a logical "AND" between more activation-conditions of a profile (cit.: "A profile is activated when all activation criteria has been satisfied. For example, a profile could list an Operating System family of Windows, and a JDK version of 1.4, this profile will only be activated when the build is executed on a Windows machine running Java 1.4."). 
> Suprisingly, Maven's real behavior suggests, that the logical "OR" operator is used. The attached demo project contains a profile with two activation-criteria: a property and the existence of a file. As the output shows (attachement output.txt), the fulfillment of a single criterion is enough for activating the profile. Also the corresponding implementation in the Maven core expresses the intention to use an "OR" logic (maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java r813685 (branch 2.2.x), line 268):
> for ( Iterator activatorIterator = activators.iterator(); activatorIterator.hasNext(); )
> {
>     ProfileActivator activator = (ProfileActivator) activatorIterator.next();
>     if ( activator.canDetermineActivation( profile ) )
>     {
>         if ( activator.isActive( profile ) )
>         {
>             return true;
>         }
>     }
> }
> return false;
> As I'm considering the documentation's variant more reasonable, I'm reporting this as a bug instead of a documentation-issue.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MNG-4516) Contradiction between the documentation and Maven's behavior related to profile-activation with multiple criteria

Posted by "Barnabas Bodnar (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-4516?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=205053#action_205053 ] 

Barnabas Bodnar edited comment on MNG-4516 at 1/4/10 1:27 PM:
--------------------------------------------------------------

In my example-project I didn't use variables (except in the project-name and local ones in the Ant-part). Besides, what should of effect have the interpolation onto the logical relation between the activation criteria?



      was (Author: bbodnar):
    In my example-project I didn't use variables (except the project-name and local ones in the Ant-part). Besides, what should of effect have the interpolation onto the logical relation between the activation criteria?


  
> Contradiction between the documentation and Maven's behavior related to profile-activation with multiple criteria
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-4516
>                 URL: http://jira.codehaus.org/browse/MNG-4516
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Profiles
>    Affects Versions: 2.2.1
>            Reporter: Barnabas Bodnar
>            Priority: Critical
>         Attachments: debug_output.txt, output.txt, pom.xml
>
>
> The chapter 5.3.1 of the Maven Complete Reference (edition 0.2.1, Novemeber 2009) speaks unambiguously about considering a logical "AND" between more activation-conditions of a profile (cit.: "A profile is activated when all activation criteria has been satisfied. For example, a profile could list an Operating System family of Windows, and a JDK version of 1.4, this profile will only be activated when the build is executed on a Windows machine running Java 1.4."). 
> Suprisingly, Maven's real behavior suggests, that the logical "OR" operator is used. The attached demo project contains a profile with two activation-criteria: a property and the existence of a file. As the output shows (attachement output.txt), the fulfillment of a single criterion is enough for activating the profile. Also the corresponding implementation in the Maven core expresses the intention to use an "OR" logic (maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java r813685 (branch 2.2.x), line 268):
> for ( Iterator activatorIterator = activators.iterator(); activatorIterator.hasNext(); )
> {
>     ProfileActivator activator = (ProfileActivator) activatorIterator.next();
>     if ( activator.canDetermineActivation( profile ) )
>     {
>         if ( activator.isActive( profile ) )
>         {
>             return true;
>         }
>     }
> }
> return false;
> As I'm considering the documentation's variant more reasonable, I'm reporting this as a bug instead of a documentation-issue.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MNG-4516) Contradiction between the documentation and Maven's behavior related to profile-activation with multiple criteria

Posted by "Benjamin Haag (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MNG-4516?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=288807#comment-288807 ] 

Benjamin Haag commented on MNG-4516:
------------------------------------

If this Issue was Issues to be reviewed for 3.x, as it says, what were the results?
Activation via settings.xml is useless without an OR condition. 

And as long as there is an activation used in the settings.xml, it is impossible to choose the correct profile via -P profile on the commandline ... 

Is nobody willing to fix that problem in the official version? 
                
> Contradiction between the documentation and Maven's behavior related to profile-activation with multiple criteria
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-4516
>                 URL: https://jira.codehaus.org/browse/MNG-4516
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Profiles
>    Affects Versions: 2.2.1
>            Reporter: Barnabas Bodnar
>            Priority: Critical
>             Fix For: Issues to be reviewed for 3.x
>
>         Attachments: debug_output.txt, example2.zip, output.txt, pom.xml
>
>
> The chapter 5.3.1 of the Maven Complete Reference (edition 0.2.1, Novemeber 2009) speaks unambiguously about considering a logical "AND" between more activation-conditions of a profile (cit.: "A profile is activated when all activation criteria has been satisfied. For example, a profile could list an Operating System family of Windows, and a JDK version of 1.4, this profile will only be activated when the build is executed on a Windows machine running Java 1.4."). 
> Suprisingly, Maven's real behavior suggests, that the logical "OR" operator is used. The attached demo project contains a profile with two activation-criteria: a property and the existence of a file. As the output shows (attachement output.txt), the fulfillment of a single criterion is enough for activating the profile. Also the corresponding implementation in the Maven core expresses the intention to use an "OR" logic (maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java r813685 (branch 2.2.x), line 268):
> for ( Iterator activatorIterator = activators.iterator(); activatorIterator.hasNext(); )
> {
>     ProfileActivator activator = (ProfileActivator) activatorIterator.next();
>     if ( activator.canDetermineActivation( profile ) )
>     {
>         if ( activator.isActive( profile ) )
>         {
>             return true;
>         }
>     }
> }
> return false;
> As I'm considering the documentation's variant more reasonable, I'm reporting this as a bug instead of a documentation-issue.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MNG-4516) Contradiction between the documentation and Maven's behavior related to profile-activation with multiple criteria

Posted by "Barnabas Bodnar (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-4516?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=205053#action_205053 ] 

Barnabas Bodnar edited comment on MNG-4516 at 1/4/10 1:27 PM:
--------------------------------------------------------------

In my example-project I didn't use variables (except in the project-name and the local ones in the Ant-part). Besides, what should of effect have the interpolation onto the logical relation between the activation criteria?



      was (Author: bbodnar):
    In my example-project I didn't use variables (except in the project-name and local ones in the Ant-part). Besides, what should of effect have the interpolation onto the logical relation between the activation criteria?


  
> Contradiction between the documentation and Maven's behavior related to profile-activation with multiple criteria
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-4516
>                 URL: http://jira.codehaus.org/browse/MNG-4516
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Profiles
>    Affects Versions: 2.2.1
>            Reporter: Barnabas Bodnar
>            Priority: Critical
>         Attachments: debug_output.txt, output.txt, pom.xml
>
>
> The chapter 5.3.1 of the Maven Complete Reference (edition 0.2.1, Novemeber 2009) speaks unambiguously about considering a logical "AND" between more activation-conditions of a profile (cit.: "A profile is activated when all activation criteria has been satisfied. For example, a profile could list an Operating System family of Windows, and a JDK version of 1.4, this profile will only be activated when the build is executed on a Windows machine running Java 1.4."). 
> Suprisingly, Maven's real behavior suggests, that the logical "OR" operator is used. The attached demo project contains a profile with two activation-criteria: a property and the existence of a file. As the output shows (attachement output.txt), the fulfillment of a single criterion is enough for activating the profile. Also the corresponding implementation in the Maven core expresses the intention to use an "OR" logic (maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java r813685 (branch 2.2.x), line 268):
> for ( Iterator activatorIterator = activators.iterator(); activatorIterator.hasNext(); )
> {
>     ProfileActivator activator = (ProfileActivator) activatorIterator.next();
>     if ( activator.canDetermineActivation( profile ) )
>     {
>         if ( activator.isActive( profile ) )
>         {
>             return true;
>         }
>     }
> }
> return false;
> As I'm considering the documentation's variant more reasonable, I'm reporting this as a bug instead of a documentation-issue.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNG-4516) Contradiction between the documentation and Maven's behavior related to profile-activation with multiple criteria

Posted by "Eric Pabst (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-4516?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=264309#action_264309 ] 

Eric Pabst commented on MNG-4516:
---------------------------------

I have a fix for this here:
https://github.com/epabst/maven-3/tree/MNG-4516

> Contradiction between the documentation and Maven's behavior related to profile-activation with multiple criteria
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-4516
>                 URL: http://jira.codehaus.org/browse/MNG-4516
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Profiles
>    Affects Versions: 2.2.1
>            Reporter: Barnabas Bodnar
>            Priority: Critical
>             Fix For: Issues to be reviewed for 3.x
>
>         Attachments: debug_output.txt, example2.zip, output.txt, pom.xml
>
>
> The chapter 5.3.1 of the Maven Complete Reference (edition 0.2.1, Novemeber 2009) speaks unambiguously about considering a logical "AND" between more activation-conditions of a profile (cit.: "A profile is activated when all activation criteria has been satisfied. For example, a profile could list an Operating System family of Windows, and a JDK version of 1.4, this profile will only be activated when the build is executed on a Windows machine running Java 1.4."). 
> Suprisingly, Maven's real behavior suggests, that the logical "OR" operator is used. The attached demo project contains a profile with two activation-criteria: a property and the existence of a file. As the output shows (attachement output.txt), the fulfillment of a single criterion is enough for activating the profile. Also the corresponding implementation in the Maven core expresses the intention to use an "OR" logic (maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java r813685 (branch 2.2.x), line 268):
> for ( Iterator activatorIterator = activators.iterator(); activatorIterator.hasNext(); )
> {
>     ProfileActivator activator = (ProfileActivator) activatorIterator.next();
>     if ( activator.canDetermineActivation( profile ) )
>     {
>         if ( activator.isActive( profile ) )
>         {
>             return true;
>         }
>     }
> }
> return false;
> As I'm considering the documentation's variant more reasonable, I'm reporting this as a bug instead of a documentation-issue.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MNG-4516) Contradiction between the documentation and Maven's behavior related to profile-activation with multiple criteria

Posted by "Barnabas Bodnar (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-4516?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=205373#action_205373 ] 

Barnabas Bodnar edited comment on MNG-4516 at 1/6/10 8:15 AM:
--------------------------------------------------------------

Apparently it was consciously decided for an "OR"-logic in the version 2.0.x (MNG-3106), although the documentation of that version too spoke about an "AND"-logic. Which were the reasons for it?


      was (Author: bbodnar):
    Apparently it was consciously decided for an "OR"-logic in the version 2.0.x (MNG-3106), although the documentation of that version too spoke about an "AND"-logic. Which were the arguments for it?

  
> Contradiction between the documentation and Maven's behavior related to profile-activation with multiple criteria
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-4516
>                 URL: http://jira.codehaus.org/browse/MNG-4516
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Profiles
>    Affects Versions: 2.2.1
>            Reporter: Barnabas Bodnar
>            Priority: Critical
>         Attachments: debug_output.txt, example2.zip, output.txt, pom.xml
>
>
> The chapter 5.3.1 of the Maven Complete Reference (edition 0.2.1, Novemeber 2009) speaks unambiguously about considering a logical "AND" between more activation-conditions of a profile (cit.: "A profile is activated when all activation criteria has been satisfied. For example, a profile could list an Operating System family of Windows, and a JDK version of 1.4, this profile will only be activated when the build is executed on a Windows machine running Java 1.4."). 
> Suprisingly, Maven's real behavior suggests, that the logical "OR" operator is used. The attached demo project contains a profile with two activation-criteria: a property and the existence of a file. As the output shows (attachement output.txt), the fulfillment of a single criterion is enough for activating the profile. Also the corresponding implementation in the Maven core expresses the intention to use an "OR" logic (maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java r813685 (branch 2.2.x), line 268):
> for ( Iterator activatorIterator = activators.iterator(); activatorIterator.hasNext(); )
> {
>     ProfileActivator activator = (ProfileActivator) activatorIterator.next();
>     if ( activator.canDetermineActivation( profile ) )
>     {
>         if ( activator.isActive( profile ) )
>         {
>             return true;
>         }
>     }
> }
> return false;
> As I'm considering the documentation's variant more reasonable, I'm reporting this as a bug instead of a documentation-issue.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNG-4516) Contradiction between the documentation and Maven's behavior related to profile-activation with multiple criteria

Posted by "Barnabas Bodnar (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-4516?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=205373#action_205373 ] 

Barnabas Bodnar commented on MNG-4516:
--------------------------------------

Apparently it was consciously decided for an "OR"-logic in the version 2.0.x (MNG-3106), although the documentation of that version too spoke about an "AND"-logic. Which were the arguments for it?


> Contradiction between the documentation and Maven's behavior related to profile-activation with multiple criteria
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-4516
>                 URL: http://jira.codehaus.org/browse/MNG-4516
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Profiles
>    Affects Versions: 2.2.1
>            Reporter: Barnabas Bodnar
>            Priority: Critical
>         Attachments: debug_output.txt, example2.zip, output.txt, pom.xml
>
>
> The chapter 5.3.1 of the Maven Complete Reference (edition 0.2.1, Novemeber 2009) speaks unambiguously about considering a logical "AND" between more activation-conditions of a profile (cit.: "A profile is activated when all activation criteria has been satisfied. For example, a profile could list an Operating System family of Windows, and a JDK version of 1.4, this profile will only be activated when the build is executed on a Windows machine running Java 1.4."). 
> Suprisingly, Maven's real behavior suggests, that the logical "OR" operator is used. The attached demo project contains a profile with two activation-criteria: a property and the existence of a file. As the output shows (attachement output.txt), the fulfillment of a single criterion is enough for activating the profile. Also the corresponding implementation in the Maven core expresses the intention to use an "OR" logic (maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java r813685 (branch 2.2.x), line 268):
> for ( Iterator activatorIterator = activators.iterator(); activatorIterator.hasNext(); )
> {
>     ProfileActivator activator = (ProfileActivator) activatorIterator.next();
>     if ( activator.canDetermineActivation( profile ) )
>     {
>         if ( activator.isActive( profile ) )
>         {
>             return true;
>         }
>     }
> }
> return false;
> As I'm considering the documentation's variant more reasonable, I'm reporting this as a bug instead of a documentation-issue.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNG-4516) Contradiction between the documentation and Maven's behavior related to profile-activation with multiple criteria

Posted by "Dennis Lundberg (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-4516?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=205047#action_205047 ] 

Dennis Lundberg commented on MNG-4516:
--------------------------------------

If you read this:
http://maven.apache.org/guides/introduction/introduction-to-profiles.html

you will see:

"As of Maven 2.0.9, the tags <exists> and <missing> could be interpolated. Supported variables are system properties like ${user.home} and enviroment variables like ${env.HOME}. Please note that properties defined in the POM itself are not available for interpolation here."

> Contradiction between the documentation and Maven's behavior related to profile-activation with multiple criteria
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-4516
>                 URL: http://jira.codehaus.org/browse/MNG-4516
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Profiles
>    Affects Versions: 2.2.1
>            Reporter: Barnabas Bodnar
>            Priority: Critical
>         Attachments: debug_output.txt, output.txt, pom.xml
>
>
> The chapter 5.3.1 of the Maven Complete Reference (edition 0.2.1, Novemeber 2009) speaks unambiguously about considering a logical "AND" between more activation-conditions of a profile (cit.: "A profile is activated when all activation criteria has been satisfied. For example, a profile could list an Operating System family of Windows, and a JDK version of 1.4, this profile will only be activated when the build is executed on a Windows machine running Java 1.4."). 
> Suprisingly, Maven's real behavior suggests, that the logical "OR" operator is used. The attached demo project contains a profile with two activation-criteria: a property and the existence of a file. As the output shows (attachement output.txt), the fulfillment of a single criterion is enough for activating the profile. Also the corresponding implementation in the Maven core expresses the intention to use an "OR" logic (maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java r813685 (branch 2.2.x), line 268):
> for ( Iterator activatorIterator = activators.iterator(); activatorIterator.hasNext(); )
> {
>     ProfileActivator activator = (ProfileActivator) activatorIterator.next();
>     if ( activator.canDetermineActivation( profile ) )
>     {
>         if ( activator.isActive( profile ) )
>         {
>             return true;
>         }
>     }
> }
> return false;
> As I'm considering the documentation's variant more reasonable, I'm reporting this as a bug instead of a documentation-issue.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira