mirror of https://github.com/apache/maven.git
PR: MNG-371
Submitted by: Kenney Westerhof Reviewed by: Brett Porter give the location of the plugin descriptor git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@169201 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0a7842482f
commit
46e32b8b90
|
@ -47,6 +47,6 @@ public class MavenPluginDiscoverer
|
|||
public ComponentSetDescriptor createComponentDescriptors( Reader componentDescriptorConfiguration, String source )
|
||||
throws PlexusConfigurationException
|
||||
{
|
||||
return builder.build( componentDescriptorConfiguration );
|
||||
return builder.build( componentDescriptorConfiguration, source );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,6 +39,8 @@ public class PluginDescriptor
|
|||
|
||||
private String goalPrefix;
|
||||
|
||||
private String source;
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
@ -109,7 +111,7 @@ public class PluginDescriptor
|
|||
String id = constructPluginKey( groupId, artifactId, version );
|
||||
if ( groupId == null || artifactId == null || version == null )
|
||||
{
|
||||
throw new IllegalStateException( "Plugin descriptor ID incomplete: " + id );
|
||||
throw new IllegalStateException( "Plugin descriptor ID incomplete: " + id + " in " + getSource() );
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
@ -174,4 +176,14 @@ public class PluginDescriptor
|
|||
{
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setSource( String source )
|
||||
{
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public String getSource()
|
||||
{
|
||||
return source;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,11 +21,18 @@ public class PluginDescriptorBuilder
|
|||
{
|
||||
public PluginDescriptor build( Reader reader )
|
||||
throws PlexusConfigurationException
|
||||
{
|
||||
return build( reader, null );
|
||||
}
|
||||
|
||||
public PluginDescriptor build( Reader reader, String source )
|
||||
throws PlexusConfigurationException
|
||||
{
|
||||
PlexusConfiguration c = buildConfiguration( reader );
|
||||
|
||||
PluginDescriptor pluginDescriptor = new PluginDescriptor();
|
||||
|
||||
pluginDescriptor.setSource( source );
|
||||
pluginDescriptor.setGroupId( c.getChild( "groupId" ).getValue() );
|
||||
pluginDescriptor.setArtifactId( c.getChild( "artifactId" ).getValue() );
|
||||
pluginDescriptor.setVersion( c.getChild( "version" ).getValue() );
|
||||
|
|
Loading…
Reference in New Issue