ComponentDescriptor source
--------------------------

         Key: MNG-376
         URL: http://jira.codehaus.org/browse/MNG-376
     Project: m2
        Type: Improvement
  Components: maven-core  
 Environment: all (linux/jdk1.5)
    Reporter: Brett Porter
    Priority: Minor
     Fix For: 2.0-alpha-2


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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to