If you specify the plugin only in the sub module then won't it only run there?  
For example, in my parent pom I list the plugin with

       <pluginManagement>
           <plugins>
                <plugin>
                   <groupId>org.codehaus.mojo</groupId>
                   <artifactId>hibernate3-maven-plugin</artifactId>
                   <version>2.1</version>
                   <configuration>
                       <components>
                           <component>
                              etc.

That configures it globally for the sub modules but since it's in 
pluginManagement it's not part of the parent pom's build or any of the sub 
modules' builds.

Then in my sub module's pom.xml I have

   <build>
       <plugins>
           <plugin>
               <groupId>org.codehaus.mojo</groupId>
               <artifactId>hibernate3-maven-plugin</artifactId>
           </plugin>

And in the same pom I have a profile so that it generates the tables when I use 
that profile:

   <profiles>
       <profile>
           <id>localhost-hsql</id>

           <activation>
               <activeByDefault>false</activeByDefault>
           </activation>

           <build>
               <plugins>
                   <plugin>
                       <groupId>org.codehaus.mojo</groupId>
                       <artifactId>hibernate3-maven-plugin</artifactId>

                       <executions>
                           <execution>
                               <phase>process-classes</phase>

                               <goals>
                                   <goal>hbm2ddl</goal>
                               </goals>
                           </execution>
                       </executions>
                   </plugin>
               </plugins>
           </build>
       </profile>
   </profiles>

In the parent pom there's a matching profile that gives the specifics about the 
database:

       <profile>
           <id>localhost-hsql</id>

           <activation>
               <activeByDefault>false</activeByDefault>
           </activation>

           <!-- these get filtered into files in the resources dir -->
           <properties>
               
<db.url>jdbc:hsqldb:file:${basedir}/target/waitlist;shutdown=true</db.url>

               <db.user>sa</db.user>
               <db.password />

               <jdbc-db.driverClass>org.hsqldb.jdbcDriver</jdbc-db.driverClass>

               <db.schema>public</db.schema>

               
<db.hibernate.dialect>org.hibernate.dialect.HSQLDialect</db.hibernate.dialect>

               
<dbunit.dataTypeFactoryName>org.dbunit.ext.hsqldb.HsqldbDataTypeFactory</dbunit.dataTypeFactoryName>

               <hbmtool.haltOnError>false</hbmtool.haltOnError>
           </properties>
       </profile>


ksachdeva wrote:
Hi,

I have a project structure such as this

parent-dir
   a-maven-proj1
   a-maven-proj2
   pom.xml

pom.xml in parent-dir is a parent pom.xml which include a-maven-proj1 and
a-maven-proj2 as modules.

If I run "mvn test" in parent-dir this goal is executed for both the modules
and I am happy.

Now the situation is that a-maven-proj2 uses a custom plugin which has
created a specific goal, let's say customplugin:run-app.
When I run "mvn customplugin:run-app" in the parent-dir the goal is executed
for the both the modules. Since customplugin does not understand
a-maven-proj1 the execution fails.

That said, I was looking for a way such that I can specify on a command line
or in the configuration that customplugin:run-app should only be run for
a-maven-proj2.

Many thanks for the help

Regards
Kapil

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to