[ http://jira.codehaus.org/browse/MNG-4517?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benjamin Bentmann updated MNG-4517: ----------------------------------- Attachment: pom.xml The attached demo POM uses Maven 2.0.x style JDK activation and when run with Maven 2.2.1 yields: {noformat} >mvn validate -V Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200) Java version: 1.5.0_21 Java home: D:\java\jdk-1.5\jre Default locale: de_DE, platform encoding: Cp1252 OS name: "windows 7" version: "6.1" arch: "x86" Family: "windows" [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Building MNG-4517 - PASSED [INFO] task-segment: [validate] {noformat} i.e. the profile got properly activated. As a side note, the equivalent of {{<jdk>1.5</jdk>}} using a range is {{<jdk>[1.5,1.6)</jdk>}}, not {{<jdk>[1.5.)</jdk>}}. > 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 > Attachments: pom.xml > > > 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