I worked around this using the maven-invoker-plugin. Basically, it runs a new instance of Maven for each pom.xml, but I think it serves our purpose. See below for the the modified top level pom.xml.
--Peter <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.example</groupId> <artifactId>both-projects</artifactId> <version>1.0</version> <packaging>pom</packaging> <name>Both Projects</name> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-invoker-plugin</artifactId> <version>1.2</version> <executions> <execution> <id>build-everything</id> <phase>install</phase> <goals> <goal>run</goal> </goals> <configuration> <projectsDirectory>.</projectsDirectory> <goals> <goal>install</goal> </goals> <pomIncludes> <pomInclude>A/pom.xml</pomInclude> <pomInclude>B/pom.xml</pomInclude> </pomIncludes> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-invoker-plugin</artifactId> <version>1.2</version> <executions> <execution> <id>clean-everything</id> <phase>clean</phase> <goals> <goal>run</goal> </goals> <configuration> <projectsDirectory>.</projectsDirectory> <goals> <goal>clean</goal> </goals> <pomIncludes> <pomInclude>A/pom.xml</pomInclude> <pomInclude>B/pom.xml</pomInclude> </pomIncludes> </configuration> </execution> </executions> </plugin> </plugins> </build> </project> On Wed, Aug 6, 2008 at 10:32 AM, Daniel Kulp <[EMAIL PROTECTED]> wrote: > > Honestly, I don't think it's possible. > > This is a long standing bug in Maven that is SUPPOSED to be fixed for Maven > 2.1, but that doesn't seem like it's ever going to get released. :-( > > With 2.0.x, you cannot have two plugins of the same groupname/artifactid, but > different versions, in the same reactor. The only "workaround" I can suggest > is to copy the 2.0.2 artifacts into a new artifact id or something in your > own maven repository. > > Dan > > > On Wednesday 06 August 2008 10:16:33 am Peter Dobratz wrote: >> I'm trying to build using multiple versions of the cxf-codegen-plugin. >> I've distilled the problem into the following project structure: >> >> pom.xml >> A/ >> A/pom.xml (cxf-codegen-plugin version 2.0.2-incubator) >> B/ >> B/pom.xml (cxf-codegen-plugin version 2.1.1) >> >> The top level pom.xml has a modules section that lists project A and >> project B. Project A runs cxf-codegen-plugin version 2.0.2-incubator >> and project B runs cxf-codegen-plugin version 2.1.1. If I run mvn >> package in either the A directory or the B directory, the right >> version of the CXF plugin is executed, but if I run the top level >> pom.xml, cxf-codegen-plugin version 2.0.2-incubator is used for both >> project A and project B. The correct versions of the CXF jars are put >> on the compiler classpath though. >> >> The goal is to get the top level pom.xml to build both project A and >> project B. I'm somewhat new to Maven, so maybe I'm not going about >> this the right way. What's the best way for me to get the correct >> versions of cxf-codegen-plugin to run? >> >> I've pasted the above mentioned pom.xml files. >> >> Thanks, >> Peter >> > > > > -- > Daniel Kulp > [EMAIL PROTECTED] > http://www.dankulp.com/blog >
