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:
Brian E Fox 2008-01-05 02:29:16 +00:00
parent 87e08c49bd
commit 3040f3e412
1 changed files with 26 additions and 0 deletions

View File

@ -1750,4 +1750,30 @@ public class MavenProject
{ {
return (Plugin) getBuild().getPluginsAsMap().get( pluginKey ); 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();
}
} }