You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by djeddyg <ed...@mredd.co.uk> on 2009/03/06 16:57:56 UTC
Cannot specify which plugin to execute in child pom
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>
--
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.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Cannot specify which plugin to execute in child pom
Posted by Wayne Fay <wa...@gmail.com>.
> The combination of the 2 documents made me think it should be possible to
> use <id> to only inherit certain <execution> elements, is this not correct?
I've never seen this done, never done it myself, and generally doubt
that it would work. Obviously your experiences would indicate it does
not.
I'd play with <inherited>true</> and your ids, check against "mvn
help:effective-pom" and see what you can get working. But I generally
do not expect this will work the way you want it too -- I'm happy to
be proven wrong, though.
Wayne
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Cannot specify which plugin to execute in child pom
Posted by djeddyg <ed...@mredd.co.uk>.
Hi Wayne,
I may have misunderstood the documentation but I got the idea from looking
at the following docs:
The http://maven.apache.org/guides/mini/guide-configuring-plugins.html
Maven guide to configuring plugins where they define 2 different
<execution> elements each with a different <id>.
Also the
http://maven.apache.org/ref/2.0.8/maven-model/maven.html#class_pluginManagement
Maven Model states that the <id> element is 'for matching exections to
merge during inheritance.'
The combination of the 2 documents made me think it should be possible to
use <id> to only inherit certain <execution> elements, is this not correct?
Many thanks,
Edd
Wayne Fay wrote:
>
> I don't believe that what you are trying to do is possible in Maven.
> Where did you get the idea that you could declare multiple executions
> in a parent, and then specify the <id> in the child and only that
> execution would be inherited?? Or was it just an idea/assumption that
> you had which isn't working out for you?
>
> Wayne
>
> On Fri, Mar 6, 2009 at 7:57 AM, djeddyg <ed...@mredd.co.uk> wrote:
>>
>> 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>
>>
>> --
>> 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.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/Cannot-specify-which-plugin-%3Cexecution%3E-to-execute-in-child-pom-tp22375228p22379253.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Cannot specify which plugin to execute in child pom
Posted by Wayne Fay <wa...@gmail.com>.
I don't believe that what you are trying to do is possible in Maven.
Where did you get the idea that you could declare multiple executions
in a parent, and then specify the <id> in the child and only that
execution would be inherited?? Or was it just an idea/assumption that
you had which isn't working out for you?
Wayne
On Fri, Mar 6, 2009 at 7:57 AM, djeddyg <ed...@mredd.co.uk> wrote:
>
> 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>
>
> --
> 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.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org