Hi,

I am trying to write two plugins with the same groupId and goal but different artifactId. For example.

com.foo.bar.myOne-maven-plugin & com.foo.bar.myTwo-maven-plugin

In both these plugins I would like to configure goalPrefixes as "myone" and "mytwo". I am using maven-plugin-plugin for doing this with version 2.3

When I use mvn myone:<<GOAL>> it works fine. However when I use mvn mytwo:<<GOAL>> it still executes the myone plugin.

When I checked the depot location for how these plugins have been provisioned I find the maven-metadata-local.xml file to have these configs.


|$/> cd /usr/local/.m2/repositories/3.0/com/foo/bar/
$/> cat maven-metadata-local.xml

<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<plugins>
<plugin>
<name>My First Plugin</name>
<prefix>myone</prefix>
<artifactId>myOne-maven-plugin</artifactId>
</plugin>
<plugin>
<name>My Second Plugin</name>
<prefix>mytwo</prefix>
<artifactId>myOne-maven-plugin</artifactId> <!-- SHOULD BEEN myTwo-maven-plugin -->
</plugin>
</plugins>
</metadata>|

This is a bug in maven-plugin-plugin version 2.3. Has this issue been resolved or should I file this bug in JIRA.

Steps to reproduce the bug:

1.) Take two artifacts with same groupId.
2.) Configure goalPrefix by using maven-plugin-plugin. For both the plugins
<build>
<plugins>
<plugin>
<artifactId>maven-plugin-plugin</artifactId>
<version>2.3</version>
<configuration>
<goalPrefix>myone</goalPrefix>
</configuration>
</plugin>
</plugins>
</build>
3.) Provision these plugins into your local repo.
4.) Execute the plugins using goalPrefix. And for further investigation please check the maven-metadata-local.xml


Thanks,
Dhawan

Reply via email to