问题描述:

I have two generic questions on Maven pom & plugin configuration

  1. In super pom it is mentioned as <!-- NOTE: These plugins will be removed from future versions of the super POM -->.

    Why are they moving it & where will it be moved?

  2. As per this we don't need to specify "org.apache.maven.plugins & org.codehaus.mojo" group ids in plugin configuration.

    How & why maven is using these two group ids alone?

网友答案:

The parts which you mentioned are the following plugins:

maven-antrun-plugin, maven-assembly-plugin, maven-dependency-plugin and maven-release-plugin. These plugins are usually not bound to the build cycle so they are really not necessary for doing an sucessfull build. That's the reason why they will be removed in the future.

The second things is related to the calling of plugins on command line like this:

mvn version:set -DnewVersion=1.0

where this call implies that the groupId of the plugin in this case org.codehaus.mojo is not needed to be specified, cause it is default but this is different from the usage within the pom file for example in the plugin definitions like in the following example:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-compiler-plugin</artifactId>
  <version>3.1</version>
  ..
</plugin>

The above can be abbreviated like this:

<plugin>
  <artifactId>maven-compiler-plugin</artifactId>
  <version>3.1</version>
  ..
</plugin>

In the definition of the XSD modell you can see what's exactly the default which is only org.apache.maven.plugins .

相关阅读:
Top