At first sight, I'd say this is a use case for pluginManagement.
You'd need to add the configuration you show above inside the
<pluginManagement> part in your parent pom.

Then, in each child module where you want to execute maven-antrun-plugin
based on that config, you just put:
<build>
 <plugins>
  <plugin>
     <artifactId>maven-antrun-plugin</artifactId>
  </plugin>
 </plugins>
</build>

Anything you put inside the pluginManagement part in your parent pom will
get inherited here when used, but actually not executed for the parent pom
(unless you also it inside the build/plugins part, obviously).

Another convoluted way could have been to tweak this based on a profile
activation declared in the parent, and only activated in the children, but
it doesn't seem possible:
http://stackoverflow.com/questions/1504850/maven-activate-child-profile-based-on-property


-- Cheers


2013/4/2 laredotornado-3 <[email protected]>

> Hi,
>
> I'm using Maven 3.0.3.  I've included this plugin in a profile in my parent
> pom, however, when I run my parent pom, I don't want this to be executed as
> part of the parent pom being built (I do want it executed for each of the
> child modules).  How can I make this plugin not run during the parent
> execution phase?
>
>         <modelVersion>4.0.0</modelVersion>
>         <groupId>org.mainco.subco</groupId>
>         <artifactId>subco</artifactId>
>         <version>12.0.0-SNAPSHOT</version>
>         <modules>
>                 <module>moduleA</module>
>                 <module>moduleB</module>
>                 <module>moduleC</module>
>                 <packaging>pom</packaging>
>
>         <profiles>
>                 <profile>
>                         ...
>                                         <plugin>
>
> <groupId>org.liquibase</groupId>
>
> <artifactId>liquibase-maven-plugin</artifactId>
>                                                 <version>2.0.1</version>
>                                                 <dependencies>
>                                                         <dependency>
>
> <groupId>mysql</groupId>
>
> <artifactId>mysql-connector-java</artifactId>
>
> <version>5.1.18</version>
>                                                         </dependency>
>                                                 </dependencies>
>                                                 <executions>
>                                                         <execution>
>
> <id>build-database</id>
>
> <phase>process-test-resources</phase>
>
> <configuration>
>
> <driver>com.mysql.jdbc.Driver</driver>
>
>
> <url>jdbc:mysql://${test.mysql.db.host}:${test.mysql.db.port}/${test.mysql.db.sid}</url>
>
> <username>${test.mysql.db.user}</username>
>
> <password>${test.mysql.db.password}</password>
>
>
> <changeLogFile>${project.build.directory}/db.changelog-master.xml</changeLogFile>
>
> <promptOnNonLocalDatabase>false</promptOnNonLocalDatabase>
>
> </configuration>
>                                                                 <goals>
>
> <goal>update</goal>
>                                                                 </goals>
>                                                         </execution>
>                                                 </executions>
>                                         </plugin>
>
> Thanks, - Dave
>
>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Can-I-force-a-plugin-to-not-run-during-parent-pom-execution-phase-tp5752479.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>


-- 
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !

Reply via email to