djeddyg
2009-03-06 15:57:56 UTC
Hi,
I have a project which consists of a parent POM and 2 child POMs, the parent
POM uses the exec-maven-plugin plugin and defines 2 <execute> elements, each
with a different <id> but bound to the same phase. I want to have one of my
child POMs inherit one <execution> and the other child POM inherit the other
<execution> hence I am referencing the appropriate <id> in each child POM.
No matter which <id> I reference in the child POM, both <execution> elements
are always executed in both child POMs.
Has anyone gotten this to work successfully? I have included snippits of my
3 POMs at the end of the mail so you can see exactly what I have done.
Many thanks,
Edd
Parent POM snippit:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<id>ExecDatabaseBuild</id>
<goals>
<goal>exec</goal>
</goals>
<phase>process-test-resources</phase>
<inherited>true</inherited>
<configuration>
<executable>sqlplus</executable>
<workingDirectory>${project.parent.basedir}/src/main/resources/db</workingDirectory>
<arguments>
<argument>${db.user}/${db.password}@${db.sid}</argument>
<argument>@1_create_db.sql</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>DoSomethingElse</id>
<goals>
<goal>exec</goal>
</goals>
<phase>process-test-resources</phase>
<inherited>true</inherited>
<configuration>
<executable>dir</executable>
<workingDirectory>${project.parent.basedir}/src/main/resources/db</workingDirectory>
<arguments>
<argument>/p</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
And in one of my child POMs I have:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<id>DoSomethingElse</id>
</execution>
</executions>
</plugin>
And in the other child POM I have:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<id>ExecDatabaseBuild</id>
</execution>
</executions>
</plugin>
I have a project which consists of a parent POM and 2 child POMs, the parent
POM uses the exec-maven-plugin plugin and defines 2 <execute> elements, each
with a different <id> but bound to the same phase. I want to have one of my
child POMs inherit one <execution> and the other child POM inherit the other
<execution> hence I am referencing the appropriate <id> in each child POM.
No matter which <id> I reference in the child POM, both <execution> elements
are always executed in both child POMs.
Has anyone gotten this to work successfully? I have included snippits of my
3 POMs at the end of the mail so you can see exactly what I have done.
Many thanks,
Edd
Parent POM snippit:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<id>ExecDatabaseBuild</id>
<goals>
<goal>exec</goal>
</goals>
<phase>process-test-resources</phase>
<inherited>true</inherited>
<configuration>
<executable>sqlplus</executable>
<workingDirectory>${project.parent.basedir}/src/main/resources/db</workingDirectory>
<arguments>
<argument>${db.user}/${db.password}@${db.sid}</argument>
<argument>@1_create_db.sql</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>DoSomethingElse</id>
<goals>
<goal>exec</goal>
</goals>
<phase>process-test-resources</phase>
<inherited>true</inherited>
<configuration>
<executable>dir</executable>
<workingDirectory>${project.parent.basedir}/src/main/resources/db</workingDirectory>
<arguments>
<argument>/p</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
And in one of my child POMs I have:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<id>DoSomethingElse</id>
</execution>
</executions>
</plugin>
And in the other child POM I have:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<id>ExecDatabaseBuild</id>
</execution>
</executions>
</plugin>
--
View this message in context: http://www.nabble.com/Cannot-specify-which-plugin-%3Cexecution%3E-to-execute-in-child-pom-tp22375228p22375228.html
Sent from the Maven - Users mailing list archive at Nabble.com.
View this message in context: http://www.nabble.com/Cannot-specify-which-plugin-%3Cexecution%3E-to-execute-in-child-pom-tp22375228p22375228.html
Sent from the Maven - Users mailing list archive at Nabble.com.