mirror of https://github.com/apache/maven.git
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:
parent
3f68f32abf
commit
36092a009d
|
@ -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 )
|
||||
{
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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 )
|
||||
|
|
Loading…
Reference in New Issue