Issue
I have a pom.xml without declaring the versions-maven-plugin
<!-- no need to declare this in my pom.xml, plugin still works -->
<plugin>
<!-- https://www.mojohaus.org/versions-maven-plugin/ -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.7</version>
<inherited>false</inherited>
</plugin>
When using mvn versions:display-property-updates
, the plugin works even if I did not include the plugin in my pom.xml
. Are all plugins from code org.codehaus.mojo already included in the maven distribution?
Solution
If you look at the default settings.xml
file that ships with Maven, you will see:
pluginGroups
This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e. when invoking a command line like "mvn prefix:goal". Maven will automatically add the group identifiers "org.apache.maven.plugins" and "org.codehaus.mojo" if these are not already contained in the list.
You can see the effective settings with:
$ mvn help:effective-settings
If you want to add additional groups, you can do so in your local settings.xml
(by default located at $HOME/.m2/settings.xml
):
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<pluginGroups>
<!-- Add stackoverflow maven plugins -->
<pluginGroup>com.stackoverflow.plugins</plugingroup>
</pluginGroups>
</settings>
Answered By - Sean Bright