o Fixed NPE

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@965100 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2010-07-17 16:18:14 +00:00
parent da5c998ec9
commit b1e147f59d
1 changed files with 8 additions and 2 deletions

View File

@ -123,9 +123,15 @@ public class BuildPomMojo
MavenProject project = builder.buildFromRepository( artifact, remoteRepositories, localRepository );
String key = artifact.getId() + ".";
props.setProperty( key + "project.name", project.getName() );
props.setProperty( key + "project.description", project.getDescription() );
props.setProperty( key + "project.id", project.getId() );
if ( project.getName() != null )
{
props.setProperty( key + "project.name", project.getName() );
}
if ( project.getDescription() != null )
{
props.setProperty( key + "project.description", project.getDescription() );
}
if ( project.getArtifact() != null )
{
props.setProperty( key + "artifact.id", project.getArtifact().getId() );