mirror of https://github.com/apache/maven.git
MNG-3201: added toString() merged 587355-56 from 2.0.x
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@609083 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
87e08c49bd
commit
3040f3e412
|
@ -1750,4 +1750,30 @@ public class MavenProject
|
|||
{
|
||||
return (Plugin) getBuild().getPluginsAsMap().get( pluginKey );
|
||||
}
|
||||
/**
|
||||
* Default toString
|
||||
*/
|
||||
public String toString()
|
||||
{
|
||||
StringBuffer sb = new StringBuffer(30);
|
||||
sb.append( "MavenProject: " );
|
||||
sb.append( this.getGroupId() );
|
||||
sb.append( ":" );
|
||||
sb.append( this.getArtifactId() );
|
||||
sb.append( ":" );
|
||||
sb.append( this.getVersion() );
|
||||
sb.append( " @ " );
|
||||
|
||||
try
|
||||
{
|
||||
sb.append( this.getFile().getPath() );
|
||||
}
|
||||
catch (NullPointerException e)
|
||||
{
|
||||
//don't log it.
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue