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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With