Remove model cloning.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@700325 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Britton Isbell 2008-09-30 01:58:20 +00:00
parent 3af42c2f05
commit 9220e682ec
4 changed files with 5 additions and 17 deletions

View File

@ -515,7 +515,7 @@ public class DefaultPluginManager
getLogger().warn( "Mojo: " + mojoDescriptor.getGoal() + " is deprecated.\n" + mojoDescriptor.getDeprecated() ); getLogger().warn( "Mojo: " + mojoDescriptor.getGoal() + " is deprecated.\n" + mojoDescriptor.getDeprecated() );
} }
Model model = ModelUtils.cloneModel( project.getModel() ); Model model = project.getModel();
pathTranslator.alignToBaseDirectory( model, project.getBasedir() ); pathTranslator.alignToBaseDirectory( model, project.getBasedir() );
project.setBuild( model.getBuild() ); project.setBuild( model.getBuild() );

View File

@ -196,7 +196,7 @@ public class DefaultMavenProjectBuilder
superModel.setVersion( STANDALONE_SUPERPOM_VERSION ); superModel.setVersion( STANDALONE_SUPERPOM_VERSION );
superModel = ModelUtils.cloneModel( superModel ); superModel = superModel;
ProfileManager profileManager = config.getGlobalProfileManager(); ProfileManager profileManager = config.getGlobalProfileManager();

View File

@ -203,7 +203,7 @@ public class MavenProject
this.artifactFactory = artifactFactory; this.artifactFactory = artifactFactory;
this.mavenProjectBuilder = mavenProjectBuilder; this.mavenProjectBuilder = mavenProjectBuilder;
this.projectBuilderConfiguration = projectBuilderConfiguration; this.projectBuilderConfiguration = projectBuilderConfiguration;
originalModel = ModelUtils.cloneModel( model ); originalModel = model;
DistributionManagement dm = model.getDistributionManagement(); DistributionManagement dm = model.getDistributionManagement();
if ( dm != null ) if ( dm != null )
@ -1980,11 +1980,11 @@ public class MavenProject
setScriptSourceRoots( ( new ArrayList( project.getScriptSourceRoots() ) ) ); setScriptSourceRoots( ( new ArrayList( project.getScriptSourceRoots() ) ) );
} }
setModel( ( ModelUtils.cloneModel( project.getModel() ) ) ); setModel( project.getModel() );
if ( project.getOriginalModel() != null ) if ( project.getOriginalModel() != null )
{ {
setOriginalModel( ( ModelUtils.cloneModel( project.getOriginalModel() ) ) ); setOriginalModel( project.getOriginalModel() );
} }
setExecutionRoot( project.isExecutionRoot() ); setExecutionRoot( project.isExecutionRoot() );

View File

@ -20,10 +20,8 @@ package org.apache.maven.project;
*/ */
import org.apache.maven.model.*; import org.apache.maven.model.*;
import org.apache.maven.project.builder.PomClassicDomainModel;
import org.codehaus.plexus.util.xml.Xpp3Dom; import org.codehaus.plexus.util.xml.Xpp3Dom;
import java.io.IOException;
import java.util.*; import java.util.*;
public final class ModelUtils public final class ModelUtils
@ -312,16 +310,6 @@ public final class ModelUtils
child.setConfiguration( childConfiguration ); child.setConfiguration( childConfiguration );
} }
public static Model cloneModel( Model model )
{
try {
return new PomClassicDomainModel(model).getModel();
} catch (IOException e) {
e.printStackTrace();
return model;
}
}
public static List mergeRepositoryLists( List dominant, List recessive ) public static List mergeRepositoryLists( List dominant, List recessive )
{ {
List repositories = new ArrayList(); List repositories = new ArrayList();