o Fixed NPE

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@798536 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-07-28 14:39:09 +00:00
parent fdb57e65ca
commit a151c6c1a3
1 changed files with 13 additions and 10 deletions

View File

@ -707,19 +707,22 @@ public class DefaultLifecycleExecutor
{
Metadata pluginMetadata = readMetadata( artifactMetadataFile );
String release = pluginMetadata.getVersioning().getRelease();
if ( StringUtils.isNotEmpty( release ) )
if ( pluginMetadata.getVersioning() != null )
{
plugin.setVersion( release );
}
else
{
String latest = pluginMetadata.getVersioning().getLatest();
String release = pluginMetadata.getVersioning().getRelease();
if ( StringUtils.isNotEmpty( latest ) )
if ( StringUtils.isNotEmpty( release ) )
{
plugin.setVersion( latest );
plugin.setVersion( release );
}
else
{
String latest = pluginMetadata.getVersioning().getLatest();
if ( StringUtils.isNotEmpty( latest ) )
{
plugin.setVersion( latest );
}
}
}
}