Adding ProjectBuilderConfiguration method for buildProjectWithDependencies, then switch the embedder.readProject* to use the ProjectBuilderConfiguration-enabled methods.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@649629 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
John Dennis Casey 2008-04-18 18:00:27 +00:00
parent 3f68f32abf
commit 36092a009d
3 changed files with 22 additions and 5 deletions

View File

@ -376,7 +376,7 @@ public class MavenEmbedder
getLogger().debug( "Building MavenProject instance: " + mavenProject );
return mavenProjectBuilder.build( mavenProject, request.getLocalRepository(), request.getProfileManager() );
return mavenProjectBuilder.build( mavenProject, request.getProjectBuildingConfiguration() );
}
/**
@ -450,8 +450,7 @@ public class MavenEmbedder
{
projectBuildingResult = mavenProjectBuilder.buildProjectWithDependencies(
request.getPom(),
request.getLocalRepository(),
request.getProfileManager() );
request.getProjectBuildingConfiguration() );
}
catch ( ProjectBuildingException e )
{

View File

@ -353,7 +353,17 @@ public class DefaultMavenProjectBuilder
ProfileManager profileManager )
throws ProjectBuildingException
{
MavenProject project = build( projectDescriptor, localRepository, profileManager );
ProjectBuilderConfiguration config = new DefaultProjectBuilderConfiguration().setLocalRepository( localRepository )
.setGlobalProfileManager( profileManager );
return buildProjectWithDependencies( projectDescriptor, config );
}
public MavenProjectBuildingResult buildProjectWithDependencies( File projectDescriptor,
ProjectBuilderConfiguration config )
throws ProjectBuildingException
{
MavenProject project = build( projectDescriptor, config );
// ----------------------------------------------------------------------
// Typically when the project builder is being used from maven proper
@ -387,7 +397,7 @@ public class DefaultMavenProjectBuilder
ArtifactResolutionRequest request = new ArtifactResolutionRequest()
.setArtifact( projectArtifact )
.setArtifactDependencies( project.getDependencyArtifacts() )
.setLocalRepository( localRepository )
.setLocalRepository( config.getLocalRepository() )
.setRemoteRepostories( project.getRemoteArtifactRepositories() )
.setManagedVersionMap( managedVersions )
.setMetadataSource( artifactMetadataSource );

View File

@ -54,6 +54,14 @@ public interface MavenProjectBuilder
ProfileManager globalProfileManager )
throws ProjectBuildingException;
MavenProjectBuildingResult buildProjectWithDependencies( File project,
ProjectBuilderConfiguration config )
throws ProjectBuildingException;
/**
* @deprecated Use {@link MavenProjectBuilder#buildProjectWithDependencies(File, ProjectBuilderConfiguration)} instead.
*/
MavenProjectBuildingResult buildProjectWithDependencies( File project,
ArtifactRepository localRepository,
ProfileManager globalProfileManager )