mirror of https://github.com/apache/maven.git
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:
parent
26fcb2bae8
commit
385fef3bda
|
@ -847,11 +847,14 @@ public class PrepareReleaseMojo
|
||||||
{
|
{
|
||||||
String snapshotVersion = projectVersion;
|
String snapshotVersion = projectVersion;
|
||||||
|
|
||||||
projectVersion = getVersionResolver().getResolvedVersion( releaseModel.getGroupId(), releaseModel.getArtifactId() );
|
projectVersion = getVersionResolver().getResolvedVersion( releaseModel.getGroupId(),
|
||||||
|
releaseModel.getArtifactId() );
|
||||||
|
|
||||||
if ( ArtifactUtils.isSnapshot( projectVersion ) )
|
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 );
|
releaseModel.setVersion( projectVersion );
|
||||||
|
@ -864,7 +867,8 @@ public class PrepareReleaseMojo
|
||||||
}
|
}
|
||||||
else if ( finalName.indexOf( "SNAPSHOT" ) > -1 )
|
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();
|
String version = artifact.getVersion();
|
||||||
if ( artifact.isSnapshot() )
|
if ( artifact.isSnapshot() )
|
||||||
{
|
{
|
||||||
version = getVersionResolver().getResolvedVersion(artifact.getGroupId(), artifact.getArtifactId() );
|
version = getVersionResolver().getResolvedVersion( artifact.getGroupId(),
|
||||||
|
artifact.getArtifactId() );
|
||||||
|
|
||||||
if ( ArtifactUtils.isSnapshot( version ) )
|
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
|
// Use original - don't want the lifecycle introduced ones
|
||||||
// TODO: but is it the right settings?
|
Build build = releaseProject.getOriginalModel().getBuild();
|
||||||
Build model = releaseProject.getModel().getBuild();
|
List plugins = build != null ? build.getPlugins() : null;
|
||||||
List plugins = model != null ? model.getPlugins() : null;
|
|
||||||
|
|
||||||
if ( plugins != null )
|
if ( plugins != null )
|
||||||
{
|
{
|
||||||
|
@ -923,7 +928,9 @@ public class PrepareReleaseMojo
|
||||||
String version;
|
String version;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
version = pluginVersionManager.resolvePluginVersion( plugin.getGroupId(), plugin.getArtifactId(), project, settings, localRepository );
|
version = pluginVersionManager.resolvePluginVersion( plugin.getGroupId(),
|
||||||
|
plugin.getArtifactId(), project,
|
||||||
|
settings, localRepository );
|
||||||
}
|
}
|
||||||
catch ( PluginVersionResolutionException e )
|
catch ( PluginVersionResolutionException e )
|
||||||
{
|
{
|
||||||
|
@ -932,7 +939,10 @@ public class PrepareReleaseMojo
|
||||||
|
|
||||||
if ( ArtifactUtils.isSnapshot( version ) )
|
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 );
|
plugin.setVersion( version );
|
||||||
|
@ -961,7 +971,10 @@ public class PrepareReleaseMojo
|
||||||
|
|
||||||
if ( ArtifactUtils.isSnapshot( version ) )
|
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 );
|
plugin.setVersion( version );
|
||||||
|
@ -991,7 +1004,8 @@ public class PrepareReleaseMojo
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
relativizeBuildPaths( model, project.getFile().getParentFile().getCanonicalPath() );
|
relativizeBuildPaths( releaseProject.getModel().getBuild(),
|
||||||
|
project.getFile().getParentFile().getCanonicalPath() );
|
||||||
}
|
}
|
||||||
catch ( IOException e )
|
catch ( IOException e )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue