Dear all

I have a little application with three sub-modules. There is a parent child relation between the parent app and the sub-modules. The parent application generates code for the three sub-modules via an antrun plugin in the "generate-sources" phase. This works fine. Then each of the sub modules should compile and package the generated code into a jar.

Unfortunately, when the sub-modules reach the "generate-sources" phase, they also try to run the inherited code generation plugin. But this obviously fails, since code generation is only valid for the parent POM and not for the sub-module POMs.

Is there a way I can block my plugin (defined in the parent POM) from being executed in the sub-modules ???

Many many thanks for your advice

 Markus


Here the parent POM:

<?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.my.app</groupId>
 <artifactId>MyParentApp</artifactId>
 <name>MyParentApp</name>
 <version>1.0</version>
 <packaging>pom</packaging>

 <modules>
   <module>module-1</module>
   <module>module-2</module>
   <module>module-3</module>
 </modules>

 <dependencies>
 </dependencies>

 <build>
   <plugins>
     <plugin>
       <artifactId>maven-antrun-plugin</artifactId>
       <version>1.1</version>
       <executions>
         <execution>
           <phase>generate-sources</phase>
           <configuration>
             <tasks>
<!-- generate code for module1...3 via an ant build script -->
               <property name="some.property" value="some.value"/>
<ant antfile="build.xml" target="generate-code-for-module-1"/> <ant antfile="build.xml" target="generate-code-for-module-2"/> <ant antfile="build.xml" target="generate-code-for-module-3"/>

             </tasks>
           </configuration>
           <goals>
             <goal>run</goal>
           </goals>
         </execution>
       </executions>
     </plugin>
   </plugins>
 </build>

</project>


Here one child POM:

<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>

   <parent>
     <artifactId>MyParentApp</artifactId>
     <groupId>com.my.app</groupId>
     <version>1.0</version>
   </parent>

 <groupId>com.my.app</groupId>
 <artifactId>module-1</artifactId>
 <name>module-1</name>
 <version>1.0</version>

 <dependencies>
   ...
 </dependencies>

</project>






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to