Support Maven 2.0.x style jdk activation in Maven 2.2.x
-------------------------------------------------------

                 Key: MNG-4517
                 URL: http://jira.codehaus.org/browse/MNG-4517
             Project: Maven 2 & 3
          Issue Type: Improvement
          Components: Profiles
    Affects Versions: 2.2.1
         Environment: When someone wants to support users using Maven 2.0.x and 
Maven 2.2.x at the same time
            Reporter: Claus Ibsen


At Apache Camel we have users using different version of Maven.

Many still uses Maven 2.0.9 and which is also used by a lot of CI servers and 
whatnot.
Upgrading to Maven 2.2.1 is not always something you just do.

As camel-core uses JAXB it has dependency on those .jars but they are only 
activated if the JDK is 1.5 as they are provided out of the box with JDK 1.6+.

To facilitate this we have this in the pom.xml
{code:xml}
    <profile>
      <id>jdk1.5-maven-2.0.x</id>
      <activation>
        <!-- for maven 2.0.x syntax -->
        <jdk>1.5</jdk>
      </activation>
      <dependencies>
        <dependency>
          <groupId>javax.xml.bind</groupId>
          <artifactId>jaxb-api</artifactId>
        </dependency>
        <dependency>
          <groupId>com.sun.xml.bind</groupId>
          <artifactId>jaxb-impl</artifactId>
        </dependency>
      </dependencies>
    </profile>
{code}

As you can see its a profile for using maven 2.0.x where the <jdk> tag uses the 
syntax it understands which is plain *1.5*.

Now Maven 2.2.x breaks this as it does not support the plain syntax <jdk> 
syntax, so you cannot have the same profile for both Maven 2.0.x and 2.2.x.
That is why we have added a 2nd profile for Maven 2.2.x
{code:xml}
    <profile>
      <id>jdk1.5-maven-2.2.x</id>
      <activation>
        <!-- for maven 2.2.x syntax-->
        <jdk>[1.5,)</jdk>
      </activation>
      <dependencies>
        <dependency>
          <groupId>javax.xml.bind</groupId>
          <artifactId>jaxb-api</artifactId>
        </dependency>
        <dependency>
          <groupId>com.sun.xml.bind</groupId>
          <artifactId>jaxb-impl</artifactId>
        </dependency>
      </dependencies>
    </profile>
{code}

As you can see the <jdk> syntax is different as we need to type *[1.5,)*. 

What we propose is that Maven 2.2.x can understand the plain and simple syntax 
from 2.0.x which would be *1.5*.

What it then allows us is to have a single profile and letting it be the 
default profile (without any id).
Then people can much easier work with it without having to specify a profile id.


-- 
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

        

Reply via email to