Model releasePom = createReleaseModel( project, releaseDescriptor, releaseEnvironment, reactorProjects, result );
// write release pom to file
MavenXpp3Writer pomWriter = new MavenXpp3Writer();
File releasePomFile = ReleaseUtil.getReleasePom( project );
// MRELEASE-273 : A release pom can be null
if ( releasePomFile == null )
{
throw new ReleaseExecutionException( "Cannot generate release POM : pom file is null" );
}
Writer fileWriter = null;
try
{
fileWriter = WriterFactory.newXmlWriter( releasePomFile );
pomWriter.write( fileWriter, releasePom );
}
catch ( IOException exception )
{
throw new ReleaseExecutionException( "Cannot generate release POM", exception );
}