Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven plugin prefix resolution doesn't seem to work as expected

Tags:

maven

I've created a MOJO for a specific application need. I've followed maven's guidelines in naming the plugin so that I didn't have to mention the full

mvn groupId:artifactId:version:goal

for executing my plugin(I've named it to match the format ${prefix}-maven-plugin). I've even included the 'goalPrefix' property in the plugin POM's configuration section. Here's a sniff of what I did to my plugin's POM:

<configuration>
  <goalPrefix>${prefix}</goalPrefix>
</configuration>

But I'm still unable to execute my plugin just using mvn ${prefix}:goal since it complains it can't find the plugin in any repository. I've still had to use mvn groupId:artifactId:version:goal Any idea why?

like image 660
mystarrocks Avatar asked Aug 19 '12 12:08

mystarrocks


1 Answers

By default, Maven does only recognize plugins with the group IDs org.apache.maven.plugins and org.codehaus.mojo. If your plugin has a different group ID (which should be the case), you need to add this group ID as plugin group to your Maven settings.xml file:

<settings>
  ...
  <pluginGroups>
    <pluginGroup>the.groupid.of.my.plugin</pluginGroup>
  </pluginGroups>
  ...
</settings>

Take a look at the Maven Settings Reference for further details.

like image 82
Stefan Ferstl Avatar answered Dec 12 '22 18:12

Stefan Ferstl