don't include lifecycle introduced plugins (also resolves issue with release plugin snapshot)

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@290352 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-09-20 04:35:46 +00:00
parent 26fcb2bae8
commit 385fef3bda
1 changed files with 56 additions and 42 deletions

View File

@ -847,11 +847,14 @@ public class PrepareReleaseMojo
{
String snapshotVersion = projectVersion;
projectVersion = getVersionResolver().getResolvedVersion( releaseModel.getGroupId(), releaseModel.getArtifactId() );
projectVersion = getVersionResolver().getResolvedVersion( releaseModel.getGroupId(),
releaseModel.getArtifactId() );
if ( ArtifactUtils.isSnapshot( projectVersion ) )
{
throw new MojoExecutionException( "MAJOR PROBLEM!!! Cannot find resolved version to be used in releasing project: " + releaseProject.getId() );
throw new MojoExecutionException(
"MAJOR PROBLEM!!! Cannot find resolved version to be used in releasing project: " +
releaseProject.getId() );
}
releaseModel.setVersion( projectVersion );
@ -864,7 +867,8 @@ public class PrepareReleaseMojo
}
else if ( finalName.indexOf( "SNAPSHOT" ) > -1 )
{
throw new MojoExecutionException( "Cannot reliably adjust the finalName of project: " + releaseProject.getId() );
throw new MojoExecutionException(
"Cannot reliably adjust the finalName of project: " + releaseProject.getId() );
}
}
@ -889,11 +893,13 @@ public class PrepareReleaseMojo
String version = artifact.getVersion();
if ( artifact.isSnapshot() )
{
version = getVersionResolver().getResolvedVersion(artifact.getGroupId(), artifact.getArtifactId() );
version = getVersionResolver().getResolvedVersion( artifact.getGroupId(),
artifact.getArtifactId() );
if ( ArtifactUtils.isSnapshot( version ) )
{
throw new MojoExecutionException( "Unresolved SNAPSHOT version of: " + artifact.getId() + ". Cannot proceed with release." );
throw new MojoExecutionException( "Unresolved SNAPSHOT version of: " +
artifact.getId() + ". Cannot proceed with release." );
}
}
@ -909,9 +915,8 @@ public class PrepareReleaseMojo
}
// Use original - don't want the lifecycle introduced ones
// TODO: but is it the right settings?
Build model = releaseProject.getModel().getBuild();
List plugins = model != null ? model.getPlugins() : null;
Build build = releaseProject.getOriginalModel().getBuild();
List plugins = build != null ? build.getPlugins() : null;
if ( plugins != null )
{
@ -923,7 +928,9 @@ public class PrepareReleaseMojo
String version;
try
{
version = pluginVersionManager.resolvePluginVersion( plugin.getGroupId(), plugin.getArtifactId(), project, settings, localRepository );
version = pluginVersionManager.resolvePluginVersion( plugin.getGroupId(),
plugin.getArtifactId(), project,
settings, localRepository );
}
catch ( PluginVersionResolutionException e )
{
@ -932,7 +939,10 @@ public class PrepareReleaseMojo
if ( ArtifactUtils.isSnapshot( version ) )
{
throw new MojoExecutionException( "Resolved version of plugin is a snapshot. Please release this plugin before releasing this project.\n\nGroupId: " + plugin.getGroupId() + "\nArtifactId: " + plugin.getArtifactId() + "\nResolved Version: " + version + "\n\n" );
throw new MojoExecutionException(
"Resolved version of plugin is a snapshot. Please release this plugin before releasing this project.\n\nGroupId: " +
plugin.getGroupId() + "\nArtifactId: " + plugin.getArtifactId() +
"\nResolved Version: " + version + "\n\n" );
}
plugin.setVersion( version );
@ -961,7 +971,10 @@ public class PrepareReleaseMojo
if ( ArtifactUtils.isSnapshot( version ) )
{
throw new MojoExecutionException( "Resolved version of plugin is a snapshot. Please release this report plugin before releasing this project.\n\nGroupId: " + plugin.getGroupId() + "\nArtifactId: " + plugin.getArtifactId() + "\nResolved Version: " + version + "\n\n" );
throw new MojoExecutionException(
"Resolved version of plugin is a snapshot. Please release this report plugin before releasing this project.\n\nGroupId: " +
plugin.getGroupId() + "\nArtifactId: " + plugin.getArtifactId() +
"\nResolved Version: " + version + "\n\n" );
}
plugin.setVersion( version );
@ -991,7 +1004,8 @@ public class PrepareReleaseMojo
try
{
relativizeBuildPaths( model, project.getFile().getParentFile().getCanonicalPath() );
relativizeBuildPaths( releaseProject.getModel().getBuild(),
project.getFile().getParentFile().getCanonicalPath() );
}
catch ( IOException e )
{