Maven 2 & 3

PluginDescriptor location enhancement

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 2.0-alpha-2
  • Component/s: Plugins and Lifecycle
  • Labels:
    None
  • Environment:
    all (linux/jdk1.5)
  • Number of attachments :
    1

Description

I got the following error

java.lang.IllegalStateException: Plugin descriptor ID incomplete: null:null:null
at org.apache.maven.plugin.descriptor.PluginDescriptor.getId(PluginDescriptor.java:112)
at org.apache.maven.plugin.DefaultPluginManager.componentDiscovered(DefaultPluginManager.java:129)
....

I fixed the errormessage to include the location of the Plugin Descriptor plugin.xml file.
To do that, I had to modify PluginDescriptor to add a 'source' attribute; modify maven-core's
MavenPluginDiscoverer to not disregard the source parameter and pass it on to maven-plugin-descriptor's
PluginDescriptorBuilder (retaining backwards compatiblity) and set it there.

Now the errormessage looks like:

java.lang.IllegalStateException: Plugin descriptor ID incomplete: null:null:null in jar:file:/home/forge/.m2/repository/org/apache/maven/plugins/maven-war-plugin/1.0-SNAPSHOT/maven-war-plugin-1.0-20050405.162144-1.jar!/META-INF/maven/plugin.xml
at org.apache.maven.plugin.descriptor.PluginDescriptor.getId(PluginDescriptor.java:112)
at org.apache.maven.plugin.DefaultPluginManager.componentDiscovered(DefaultPluginManager.java:130)

which is a lot more helpful to me.

I thought I'd share this with you, hoping you'll find it useful enough to incorporate it.

By the way, this exception is triggered in a new NullpointerException (in DefaultPluginManager)
warning about the PluginDescriptor's version being null; while constructing this message another
exception is triggered, so the original error doesn't get through at all.

For the record, I tried to enhance Plexus' ComponentSetDescriptor, but found I could only access
the source (parameter) in 2 out of 5 places without API modification, so I abandoned this approach,
but it might prove wise to include the source there, rather than in the special case of maven's PluginManager.

Activity

There are no comments yet on this issue.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
15m
Original Estimate - 15 minutes
Remaining:
15m
Remaining Estimate - 15 minutes
Logged:
Not Specified
Time Spent - Not Specified