Maven: The plugin ‘standard maven plugin’ does not exist or no valid version could be found

A week ago, Maven started shouting “The plugin ‘org.apache.maven.plugins:maven-war-plugin’ does not exist or no valid version could be found”. What the…?! how can “maven-war-plugin” not exist?? Besides, it is in my repository!

As it turns out, it is a reasonably common issue. I managed to find some help on codehaus’ site, and it did help. But not every time.

Eventually, the best solution seems to simply delete the local repository and let Maven repopulate it.

From what I understand, it sometimes happens that some files (maybe the maven-metadata-central.xml ones?) get corrupted. Good luck when that happens on a enterprise-wide repository…

About Eric Lefevre-Ardant

Independent technical consultant.
This entry was posted in java, maven. Bookmark the permalink.

5 Responses to Maven: The plugin ‘standard maven plugin’ does not exist or no valid version could be found

  1. Anonymous says:

    How does maven re-populate the repo? When I deleted my repo it just added my dependencies for the project but I didn’t see any plugins.

  2. Eric Lefevre says:

    Are you talking about plugins attached to lifecycle phases (generate-sources, compile, etc.) or plugins that you call from the command line (eg. mvn tomcat:deploy)?

    The plugins attached to lifecycle phases should be downloaded and stored automatically, exactly at the moment they are needed. For example, if you call “mvn compile” from the command line, it was download, then execute all plugins attached to “validate”, then those attached to “generate-sources”, then “process-sources”, “generate-resources”, “process-resources” and “compile”. But not those attached to “test”, since this phase is later in the lifecycle (see http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html).

    The plugins that you call from the command line are downloaded and stored in the repository only when you call them (ie. exactly when you type the command in the command line). Even if they are configured in your pom.xml.

    If you want to force Maven to download all the dependencies, plugins, etc. that it might need, try “mvn dependency:go-offline” (details here: http://maven.apache.org/plugins/maven-dependency-plugin/).

  3. Pingback: Eric Lefevre-Ardant on Java & Agile » I am a jealous man

  4. SN says:

    Vote here if you are looking for maven support in GAE
    http://code.google.com/p/googleappengine/issues/detail?id=1296

  5. HulkHogan says:

    Thanks, you saved my day. It’s almost ridiculous, but repopulating the local repository really works.

Leave a Reply

Your email address will not be published.