Github user FredipusRex commented on the pull request:

    https://github.com/apache/maven/pull/20#issuecomment-46523185
  
    You do realize that the current OR condition is actually out in use right 
now in many POM files, right? This was previously the subject of a patch 
(MNG-3106) - originally only one condition was accepted which was patched to 
allow for ORing of conditions - arguably the wrong thing to do, but it's pretty 
well understood out in the Maven community. While this patch finally matches 
Maven to the Sonatype book, it will break a lot of POMs without recourse other 
than multiple, near duplicate activations.
    
    The right way to fix this would have been to add the ability to specify the 
condition (AND, OR), perhaps through a set of tag attributes.
    
    <activation>
        <property>
            <name>JDKCheck</name>
            <value>true</value>
        </property>
        <property>
            <name>NeedsJava4or5</name>
        </property>
        <os group="1" condition="OR" group-condition="AND">
            <name>Linux</name>
        </os>
        <jdk group="1">1.6</jdk>
        <jdk group="2" condition="AND" group-condition="OR">1.4</jdk>
        <jdk group="2">1.5</jdk>
    </activation>
    
    All conditions now belong to a group - either the default group or a named 
group attribute. Members of the default group have no attributes and are AND'd 
together (keeping the functionality of your patch). There do not need to be any 
members of the default group - in which case, it acts purely as glue to named 
groups.
    
    One member of each named group must indicate how the group relates to the 
default group via the condition attribute and how the members of the group are 
related to each other via the group-condition attribute.
    
    This allows compact but complex relationships. The above example is 
activated when the JDKCheck property is true and the NeedsJava4or5 property 
exists and the JDK is 1.4 or 1.5, or when compiling under Linux and the JDK is 
1.6. It does not allow infinite numbers of levels and parenthetical statements, 
but does provide for most common build scenarios. When there are no members of 
the default group, it should be assumed to be not activated and the first group 
(if any) with the AND condition should be considered the default group. This 
allows something like group 1-OR with group 2-AND to act like an either/or 
choice.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org

Reply via email to