You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Petar Tahchiev <pa...@gmail.com> on 2007/01/22 16:04:00 UTC

Running a plugin only for the submodules.

Hello gyus,

this time a very simple question: Is there a way to execute a plugin only
for the submodules you have and not for the present pom.xml. For instance: I
have a parent pom.xml which has several modules. Each of the modules makes
an assembly so I place the common code:

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <descriptor>src/assemble/main.xml</descriptor>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>


in their parent pom.xml. The problem is that maven tries to make an assembly
in the parent pom.xml, and since I don't have an assembly descriptor in the
parent pom's directory it fails. What I want is to place that snippet of
code in the parent pom, but execute it over the module files only.

Thanks to anyone that helps.


-- 
Regards, Petar!
Karlovo, Bulgaria.

Re: Running a plugin only for the submodules.

Posted by Wendell <wb...@gmail.com>.
I would try adding the xml fragment to a profile in your parent pom and then
activate the profile only in the sub modules.  The activation could even be
controlled by the presence of a java property that is defined when maven is
invoked.


Petar Tahchiev wrote:
> 
> Hello gyus,
> 
> this time a very simple question: Is there a way to execute a plugin only
> for the submodules you have and not for the present pom.xml. For instance:
> I
> have a parent pom.xml which has several modules. Each of the modules makes
> an assembly so I place the common code:
> 
>     <build>
>         <plugins>
>             <plugin>
>                 <groupId>org.apache.maven.plugins</groupId>
>                 <artifactId>maven-assembly-plugin</artifactId>
>                 <configuration>
>                     <descriptor>src/assemble/main.xml</descriptor>
>                 </configuration>
>                 <executions>
>                     <execution>
>                         <phase>package</phase>
>                         <goals>
>                             <goal>single</goal>
>                         </goals>
>                     </execution>
>                 </executions>
>             </plugin>
>         </plugins>
>     </build>
> 
> 
> in their parent pom.xml. The problem is that maven tries to make an
> assembly
> in the parent pom.xml, and since I don't have an assembly descriptor in
> the
> parent pom's directory it fails. What I want is to place that snippet of
> code in the parent pom, but execute it over the module files only.
> 
> Thanks to anyone that helps.
> 
> 
> -- 
> Regards, Petar!
> Karlovo, Bulgaria.
> 
> 

-- 
View this message in context: http://www.nabble.com/Running-a-plugin-only-for-the-submodules.-tf3058197s177.html#a8506835
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