Learner
Learner

Reputation: 544

Where Does Parent POM.xml resides

I am new to Maven and if it is a very basic question then please spare me.

I am working on a project which uses maven and when i am passing the site command for my project i am getting error.

[ERROR] Failed to execute goal
    org.apache.maven.plugins:maven-site-plugin:3.1:site (default-site) 
    on project mobileads: Execution default-site of goal
    org.apache.maven.plugins:maven-site-plugin:3.1:site
    failed: A required class was missing while executing
    org.apache.maven.plugins:maven-site-plugin:3.1:site:
    org/sonatype/aether/graph/DependencyFilter

I know that there is a problem with maven-site-plugin:3.1 version.

If i explicitly includes the latest version of maven-site-plugin(3.4) this problem disappears.But my question is where it is picking up maven-site-plugin:3.1 as in my project's pom.xml i can not see this plugin so it indicates me that it is picking some default settings from somewhere.

I want to know the name of that file and the location of that file in resides so that i could see all the settings.I use MAC.

Thanks in advance.

Rajesh

Upvotes: 2

Views: 1061

Answers (1)

JBaruch
JBaruch

Reputation: 22893

It's inside one of the Maven distribution jars, namely in $MAVEN_HOME/lib/maven-core-X.X.X.jar. Inside META-INF/plexus/components.xml file. Here's why:

Once upon a time (in Maven 2) until specified implicitly, plugins always used the latest version. The decision was based on two assumptions: the plugins are always getting better, so you want to get the latest one, and, since the plugin jars aren't part of your product (not even of it's production classpath), it's ok for it to sometimes break.

Later they realized that that was a really bad idea, since it makes your build not reproducible. So, it was fixed by nailing down the versions of plugins to the latest release version of the plugin available to the date of Maven release.

So, the good practice is to create a parent pom.xml with <pluginManagement> part and nail down the versions of all the plugins that are in use there.

Upvotes: 2

Related Questions