You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Sinduria,Anuradha" <An...@securecomputing.com> on 2007/10/23 15:07:30 UTC

ANT from Maven for Multi module Prj

Hi All,

 

I have multi module application and I am calling ANT for build and Maven for
site generation.

 

Parent

 ->Module 1 (common)

 ->Module 2 (web)

 

Each module has its own build.xml.

 

I am using maven ANT run plugin in my build tag of parent POM. (Created
three POM, one in parent and one each in module 1 and module 2.

Module 2 is dependent on module1)

 

When I don't use modules tag in my parent POM ,ANT build files are called
only once  but when I use module tags in my parent POM ,the ANT build file
are called again.  Am running mvn site from my parent folder

 

=========================

ANT Call in my parent POM.

=========================

<build>

<plugins>

<plugin>

         <groupId>org.apache.maven.plugins</groupId>

         <artifactId>maven-antrun-plugin</artifactId>

         <executions>

          <execution>

           <id>compile</id>

           <phase>compile</phase>

           <configuration>

            <tasks>

             <ant antfile="path to module 1 build" >

                 <target name="compile" />

             </ant>

 

             <ant antfile="path to module2 build" >

                 <target name="buildAll" />

             </ant>

 

            </tasks>

           </configuration>

           <goals>

             <goal>run</goal>

           </goals>

          </execution>

         </executions>

</plugin>

</plugins>

</build>

 

=========================

Module declaration in Parent POM

=========================

 

 

<modules>

    <module>module1</module>

    <module>module2</module>

 </modules>

 

Please let me know why it is happening.

 

 

Thanks and Regards,

Anuradha Sinduria

 

 


Re: ANT from Maven for Multi module Prj

Posted by Wayne Fay <wa...@gmail.com>.
Plugins specified in parent poms are automatically inherited by
children, thus they will be executed in the parent as well as the
children.

If you don't want them to execute in the children, you should specify
<inherited>false</false> in the plugin node.

The <modules> tag tells Maven that you want it to build not only the
parent but also its children when you build from the parent directory.

Wayne

On 10/23/07, Sinduria,Anuradha <An...@securecomputing.com> wrote:
> Hi All,
>
>
>
> I have multi module application and I am calling ANT for build and Maven for
> site generation.
>
>
>
> Parent
>
>  ->Module 1 (common)
>
>  ->Module 2 (web)
>
>
>
> Each module has its own build.xml.
>
>
>
> I am using maven ANT run plugin in my build tag of parent POM. (Created
> three POM, one in parent and one each in module 1 and module 2.
>
> Module 2 is dependent on module1)
>
>
>
> When I don't use modules tag in my parent POM ,ANT build files are called
> only once  but when I use module tags in my parent POM ,the ANT build file
> are called again.  Am running mvn site from my parent folder
>
>
>
> =========================
>
> ANT Call in my parent POM.
>
> =========================
>
> <build>
>
> <plugins>
>
> <plugin>
>
>          <groupId>org.apache.maven.plugins</groupId>
>
>          <artifactId>maven-antrun-plugin</artifactId>
>
>          <executions>
>
>           <execution>
>
>            <id>compile</id>
>
>            <phase>compile</phase>
>
>            <configuration>
>
>             <tasks>
>
>              <ant antfile="path to module 1 build" >
>
>                  <target name="compile" />
>
>              </ant>
>
>
>
>              <ant antfile="path to module2 build" >
>
>                  <target name="buildAll" />
>
>              </ant>
>
>
>
>             </tasks>
>
>            </configuration>
>
>            <goals>
>
>              <goal>run</goal>
>
>            </goals>
>
>           </execution>
>
>          </executions>
>
> </plugin>
>
> </plugins>
>
> </build>
>
>
>
> =========================
>
> Module declaration in Parent POM
>
> =========================
>
>
>
>
>
> <modules>
>
>     <module>module1</module>
>
>     <module>module2</module>
>
>  </modules>
>
>
>
> Please let me know why it is happening.
>
>
>
>
>
> Thanks and Regards,
>
> Anuradha Sinduria
>
>
>
>
>
>

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