diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java index 86092a683c..c53ece8ce2 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java @@ -27,7 +27,6 @@ import java.util.Properties; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.model.Profile; import org.apache.maven.model.building.ModelBuildingRequest; -import org.apache.maven.repository.ArtifactTransferListener; import org.sonatype.aether.RepositorySystemSession; public class DefaultProjectBuildingRequest @@ -62,8 +61,6 @@ public class DefaultProjectBuildingRequest private boolean resolveDependencies; - private ArtifactTransferListener transferListener; - public DefaultProjectBuildingRequest() { processPlugins = true; @@ -76,6 +73,25 @@ public class DefaultProjectBuildingRequest pluginArtifactRepositories = new ArrayList(); } + public DefaultProjectBuildingRequest( ProjectBuildingRequest request ) + { + this(); + setProcessPlugins( request.isProcessPlugins() ); + setProfiles( request.getProfiles() ); + setActiveProfileIds( request.getActiveProfileIds() ); + setInactiveProfileIds( request.getInactiveProfileIds() ); + setSystemProperties( request.getSystemProperties() ); + setUserProperties( request.getUserProperties() ); + setRemoteRepositories( request.getRemoteRepositories() ); + setPluginArtifactRepositories( request.getPluginArtifactRepositories() ); + setRepositorySession( request.getRepositorySession() ); + setLocalRepository( request.getLocalRepository() ); + setBuildStartTime( request.getBuildStartTime() ); + setProject( request.getProject() ); + setResolveDependencies( request.isResolveDependencies() ); + setValidationLevel( request.getValidationLevel() ); + } + public MavenProject getProject() { return project; @@ -274,16 +290,6 @@ public class DefaultProjectBuildingRequest this.buildStartTime = buildStartTime; } - public ArtifactTransferListener getTransferListener() - { - return transferListener; - } - - public void setTransferListener( ArtifactTransferListener transferListener ) - { - this.transferListener = transferListener; - } - public RepositorySystemSession getRepositorySession() { return repositorySession; diff --git a/maven-core/src/main/java/org/apache/maven/project/MavenProject.java b/maven-core/src/main/java/org/apache/maven/project/MavenProject.java index 488580ba5c..f9470e56fc 100644 --- a/maven-core/src/main/java/org/apache/maven/project/MavenProject.java +++ b/maven-core/src/main/java/org/apache/maven/project/MavenProject.java @@ -346,9 +346,12 @@ public class MavenProject */ if ( parentFile != null ) { + ProjectBuildingRequest request = new DefaultProjectBuildingRequest( projectBuilderConfiguration ); + request.setRemoteRepositories( getRemoteArtifactRepositories() ); + try { - parent = mavenProjectBuilder.build( parentFile, projectBuilderConfiguration ).getProject(); + parent = mavenProjectBuilder.build( parentFile, request ).getProject(); } catch ( ProjectBuildingException e ) { @@ -360,9 +363,12 @@ public class MavenProject } else if ( model.getParent() != null ) { + ProjectBuildingRequest request = new DefaultProjectBuildingRequest( projectBuilderConfiguration ); + request.setRemoteRepositories( getRemoteArtifactRepositories() ); + try { - parent = mavenProjectBuilder.build( getParentArtifact(), projectBuilderConfiguration ).getProject(); + parent = mavenProjectBuilder.build( getParentArtifact(), request ).getProject(); } catch ( ProjectBuildingException e ) {