Monday, April 14, 2008

IllegalStateException: The PluginDescriptor for the plugin ... was not found

Ever saw this error?

java.lang.IllegalStateException: The PluginDescriptor for the plugin Plugin [org.apache.maven.plugins:maven-resources-plugin] was not found.
        at org.apache.maven.plugin.DefaultPluginManager.addPlugin(DefaultPluginManager.java:325)
        at org.apache.maven.plugin.DefaultPluginManager.verifyVersionedPlugin(DefaultPluginManager.java:212)
        at org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(DefaultPluginManager.java:176)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1274)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor(DefaultLifecycleExecutor.java:1542)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.bindLifecycleForPackaging(DefaultLifecycleExecutor.java:1033)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.constructLifecycleMappings(DefaultLifecycleExecutor.java:997)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:477)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)

When you see this, check:

  1. That the JAR file of the plug-in is okay and that it contains a file META-INF/maven/plugin.xml
  2. That the pom.xml of the plug-in exists and is valid.
  3. That all parent POMs exist and are valid.

Good luck. I've opened this issue to get a better error message.

3 comments:

Maarten Storm said...

I had the same problem, just run this command mvn clean package install . I think that the install will not generate the plugin descriptor, package phase does this.

see for more on http://maven.apache.org/plugins/maven-plugin-plugin/usage.html

it worked for me

RameshKumar Ganesan said...

Hi it is very nice,


i'm getting some other plugin(net.sourceforge.cobertura) error, i'm not haveing any plugin.xml in my package, can you send me simple code for implementing cobertura with maven

Aaron Digulla said...

As I said: The file "plugin.xml" must be in the JAR file of the maven plugin which your project uses. Run maven with -X to see which JARs it tries to load and then check that the files are not corrupt as I explained above.

For an example how to use cobertura, see the usage page of cobertura.