The documentation is a little bit ambigious. What it means is:

In <pluginManagement> you specify the default configuration and versions of plugins used unless explicitly overwritten. Think of it as a template. No plugin goal is executed just because you mention it in <pluginManagement> section.

To actually execute a plugin you need to reference it in the <build><plugins> section of a (inheriting) pom or, as you have propably done invoke it explicitly via 'mvn myplugin:mygoal'. Either way, the configuration from the <pluginManagement> section is picked up.

-Tim

Am 11.04.2011 08:18, schrieb amaresh mourya:
But its in<pluginManagement>  section. maven documentation says it won't be
available to child POM unless I specify that plugin in<build>  section.

Please see following lines in my previous discussions:

*PluginManagement does ONE THING ONLY (essentially).
It provides a central location for all of your plugin versioning and
configuration.
THAT'S IT.

You still need to declare the<plugin>  in the<build>  section of your
various poms (children or parents) where you actually want to USE any
of those plugins in your build.*


http://www.mail-archive.com/users@maven.apache.org/msg115850.html


thanks
--Amaresh

On Mon, Apr 11, 2011 at 11:43 AM, Charles Williams<ch...@itadmins.net>wrote:

amaresh,

you include the plugin in the "Parent" therefore it is automatically
available in the child.

chuck


On 04/11/2011 08:08 AM, amaresh mourya wrote:

Hi I have a parent pom and a child POM.

*Parent POM is like : *

<?xml version="1.0" encoding="UTF-8" ?>
<project xmlns="http://maven.apache.org/POM/4.0.0";>
     <modelVersion>4.0.0</modelVersion>
     <groupId>Application6</groupId>
     <artifactId>Application6</artifactId>
     <version>1.0-SNAPSHOT</version>
     <modules>
         <module>mavenProj</module>
     </modules>
     <packaging>pom</packaging>
     <build>
     <pluginManagement>
         <plugins>
             <plugin>
                 <groupId>MyPlugins</groupId>
                 <artifactId>hiPlugin</artifactId>
                 <version>1.0</version>
                 <configuration>
                     <greetings>welcome</greetings>
                 </configuration>
             </plugin>
         </plugins>
         </pluginManagement>
     </build>
     <pluginRepositories>
         <pluginRepository>
             <id>228655859</id>
             <name>hosted</name>
             <url>http://localhost/hostedRepo/</url>
         </pluginRepository>
     </pluginRepositories>
</project>


*And Child POM is : *

<?xml version="1.0" encoding="UTF-8" ?>
<project xmlns="http://maven.apache.org/POM/4.0.0";>
     <modelVersion>4.0.0</modelVersion>
     <groupId>Application6</groupId>
     <artifactId>mavenProj</artifactId>
     <version>1.0-SNAPSHOT</version>
     <description>Project for mavenProj</description>
     <parent>
         <groupId>Application6</groupId>
         <artifactId>Application6</artifactId>
         <version>1.0-SNAPSHOT</version>
     </parent>
</project>

Please note that I have created a maven plugin (hiPlugin) that takes a
string via<greetings>   and just shows it.

*Question : My question is when I rum this plugin's goal on the child POM
I
am getting the output. I was expecting nothing to happen since I haven't
specified
<plugin>
                 <groupId>MyPlugins</groupId>
                 <artifactId>hiPlugin</artifactId>
</plugin>
  section in my child POM. And the maven documentation also says you won't
be
able to run any plugin defined the the plugiManagement section unless you
specify that plugin in child POM. here is the link :
http://maven.apache.org/pom.html#Plugin_Management



Thanks,
Amaresh
**
*



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to