What is pluginManagement in Maven’s pom.xml?

This is a snippet of my pom file.

....
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.4</version>                        
                <executions>
                    <execution>
                        <phase>install</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            ......
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
...

I use it successfully with the command

mvn install

But, when I try to enclose it into the “pluginManagement” tag, the maven-dependency-plugin stops working when I launch the install goal.
Why does the “pluginManagement” tag change the build behavior? Or should I use another goal or option?

5 Answers
5

Leave a Comment