Maven 2 & 3

Bad error message if plugin.xml is missing/corrupt

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Duplicate
  • Affects Version/s: 2.0.9
  • Fix Version/s: None
  • Component/s: Plugin API
  • Labels:
    None
  • Complexity:
    Intermediate
  • Number of attachments :
    0

Description

Take the JAR of the maven-resources-plugin, delete the file META-INF/maven/plugin.xml and run maven. You'll get this error:

java.lang.IllegalStateException: The PluginDescriptor for the plugin Plugin
[org.apache.maven.plugins:maven-resources-plugin] was not found.

Issue Links

Activity

Hide
Aaron Digulla added a comment -

Technically, this is correct but doesn't really help to locate the root cause of the problem. If maven can't read the plugin.xml file of a plugin, it should abort with an error during the XML parsing step instead of trying to use the plugin anyway.

Real world case: The plugin is downloaded via a proxy and the download aborts before the full file is transferred or the proxy returns a HTML file ("A virus was detected blahblah") instead of the JAR. This can lead to corrupt JARs in the repository which leads to the error above.

PS: Not sure if this is "Plugin API" or "Plugins and Lifecycle". Please feel free to move the error report to the right place.

Show
Aaron Digulla added a comment - Technically, this is correct but doesn't really help to locate the root cause of the problem. If maven can't read the plugin.xml file of a plugin, it should abort with an error during the XML parsing step instead of trying to use the plugin anyway. Real world case: The plugin is downloaded via a proxy and the download aborts before the full file is transferred or the proxy returns a HTML file ("A virus was detected blahblah") instead of the JAR. This can lead to corrupt JARs in the repository which leads to the error above. PS: Not sure if this is "Plugin API" or "Plugins and Lifecycle". Please feel free to move the error report to the right place.
Hide
Aaron Digulla added a comment - - edited

Thanks for the fix in 2.0.10. This one really cost me a lot of nerves

Show
Aaron Digulla added a comment - - edited Thanks for the fix in 2.0.10. This one really cost me a lot of nerves
Hide
John Casey added a comment -

Pushing to 2.0.11 so we can have a smaller set of high-value issues to target for the next release (2.0.10).

Show
John Casey added a comment - Pushing to 2.0.11 so we can have a smaller set of high-value issues to target for the next release (2.0.10).

People

Vote (1)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: