Hi,
I wonder if it is possible in a multimodules project to skip the execution
just for the parent.
For instance, if you have 2 modules and you declare the maven-antrun-plugin
configuration
in the your parent pom :
<project>
...
<modules>
<module>module1</module>
<module>module2</module>
</modules>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>validate</phase>
<configuration>
<tasks>
<echo message="project.build.directory = ${
project.build.directory}"/>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
if you execute maven 2 at the parent level, you have something like that :
[INFO] Executing tasks
[echo] project.build.directory =
P:\03-Maven\dev\tests\multimodules\test\target
[INFO] Executed tasks
[INFO]
----------------------------------------------------------------------------
[INFO] Building Unnamed - tests.multimodules:module1:jar:1.0-SNAPSHOT
[INFO] task-segment: [validate]
[INFO]
----------------------------------------------------------------------------
[INFO] [antrun:run {execution: default}]
[INFO] Executing tasks
[echo] project.build.directory =
P:\03-Maven\dev\tests\multimodules\test\module1\target
[INFO] Executed tasks
[INFO]
----------------------------------------------------------------------------
[INFO] Building Unnamed - tests.multimodules:module2:jar:1.0-SNAPSHOT
[INFO] task-segment: [validate]
[INFO]
----------------------------------------------------------------------------
[INFO] [antrun:run {execution: default}]
[INFO] Executing tasks
[echo] project.build.directory =
P:\03-Maven\dev\tests\multimodules\test\module2\target
[INFO] Executed tasks
So maven 2 execute the antrun plugin first at parent level then module1 and
module 2.
It's fine with a such simple example. But if you use for instance weblogic
ant tasks, it's a problem.
The build failed because it can't deploy a war package at the parent level.
So, It would be very nice
to can skip the execution at the parent level.
PS:
- I already try the weblogic-wlss-maven-plugin but it does not work very
well
- Of course, I can copy the configuration just in the modules or execute
maven only
in each module but it not what I want to do (imagine if you have several
modules...)
- I am also interesting to know if it possible.
Rémy