mirror of https://github.com/apache/maven.git
fix release-pom.xml
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@279063 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2464320d3a
commit
aa34ddef37
|
@ -818,19 +818,12 @@ public class PrepareReleaseMojo
|
|||
MavenProject project = (MavenProject) it.next();
|
||||
|
||||
MavenProject releaseProject = new MavenProject( project );
|
||||
Model releaseModel = releaseProject.getModel();
|
||||
Model releaseModel = releaseProject.getOriginalModel();
|
||||
|
||||
//Rewrite parent version
|
||||
if ( project.hasParent() )
|
||||
// Remove parent
|
||||
if ( releaseModel.getParent() != null )
|
||||
{
|
||||
Artifact parentArtifact = project.getParentArtifact();
|
||||
|
||||
if ( isSnapshot( parentArtifact.getBaseVersion() ) )
|
||||
{
|
||||
String version = resolveVersion( parentArtifact, "parent", releaseProject );
|
||||
|
||||
releaseModel.getParent().setVersion( version );
|
||||
}
|
||||
releaseModel.setParent( null );
|
||||
}
|
||||
|
||||
Set artifacts = releaseProject.getArtifacts();
|
||||
|
@ -921,7 +914,7 @@ public class PrepareReleaseMojo
|
|||
}
|
||||
}
|
||||
|
||||
File releasePomFile = new File( basedir, RELEASE_POM );
|
||||
File releasePomFile = new File( releaseProject.getFile().getParentFile(), RELEASE_POM );
|
||||
|
||||
Writer writer = null;
|
||||
|
||||
|
@ -929,7 +922,7 @@ public class PrepareReleaseMojo
|
|||
{
|
||||
writer = new FileWriter( releasePomFile );
|
||||
|
||||
releaseProject.writeModel( writer );
|
||||
releaseProject.writeOriginalModel( writer );
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue