2

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

AmanicA
  • 4,659
  • 1
  • 34
  • 49
Learner
  • 544
  • 1
  • 8
  • 19
  • possible duplicate of [Where is super pom for maven 3?](http://stackoverflow.com/questions/6797209/where-is-super-pom-for-maven-3) – Joe Nov 11 '14 at 11:54

1 Answers1

2

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.

JBaruch
  • 22,610
  • 5
  • 62
  • 90
  • Thanks for the reply JBaruch....So you mean to say that this is the file maven will refer for all the plugins it needs if it does not find in my project pom.xml? and So that means if i am taking the latest maven (I am using Maven 3.2.3) These plugins would have been taken care by Maven team only. and one more thing i want to know that how can i view this particular file as it is part of jar file – Learner Nov 06 '14 at 08:12