I have a multi module maven project where I want a plugin to run a bash script while building one of the child projects, in validation phase. I have defined a exec-maven-plugin in the parent project with the path of the script file and passing the phase as a parameter from the child project. But it looks like the control doesn't reach until
parent project
|_ childProject 1(project where the script file has to run before compilation)
|
|_ childProject 2
|
|_ childProject 3
parent pom:
<profiles>
<profile>
<id>my-profile</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>my-execution</id>
<phase>${phase.prop}</phase>
<configuration>
<executable>./file.cmd</executable>
</configuration>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
ChildPom1:
<properties>
<phase.prop>validate</phase.prop>
</properties>