I have a parent pom and under <pluginManagement>
I have a maven-install-plugin like so:
<artifactId>parent-project</artifactId>
<groupId>com.abc</groupId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
<executions>
<execution>
<id>abc</id>
<phase>validate</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<groupId>com.abc.a</groupId>
<artifactId>test</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<file>${basedir}/lib/test.jar</file>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
<plugins> <!--empty for demo purposes--> </plugins>
</build>
Here is one of my child projects' pom.xml:
<parent>
<artifactId>parent-project</artifactId>
<groupId>com.abc</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>com.abc</groupId>
<artifactId>child</artifactId>
<version>1.0-SNAPSHOT</version
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins> <!--empty for demo purposes--> </plugins>
</build>
I haven't defined the maven-install-plugin in the <plugins>
section for both the parent and child projects but why is it still being executed when I run the pom.xml? And how can I prevent it from executing when I run my child pom.xml?