Skip to content

Commit

Permalink
sourcepit/b2#139: Merge branch 'pu/maven-3.2.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
berndv committed Nov 30, 2014
2 parents a01c318 + d99df3a commit a911668
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

import javax.inject.Inject;

import org.apache.maven.ArtifactFilterManager;
import org.apache.maven.MavenExecutionException;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.ArtifactUtils;
Expand All @@ -43,6 +44,8 @@
import org.apache.maven.artifact.resolver.ArtifactResolutionRequest;
import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
import org.apache.maven.artifact.resolver.ResolutionErrorHandler;
import org.apache.maven.artifact.resolver.filter.AndArtifactFilter;
import org.apache.maven.artifact.resolver.filter.ExclusionSetFilter;
import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
import org.apache.maven.classrealm.ClassRealmManager;
import org.apache.maven.execution.DefaultMavenExecutionRequest;
Expand Down Expand Up @@ -110,6 +113,9 @@ public abstract class AbstractBootstrapper implements MavenExecutionParticipant

@Inject
private MojoExecutor mojoExecutor;

@Inject
private ArtifactFilterManager artifactFilterManager;

private final ImportEnforcer importEnforcer;

Expand Down Expand Up @@ -535,6 +541,9 @@ private ClassRealm getExtensionExtensionRealm(MavenSession bootSession, MavenPro
newRealm.importFrom(extensionRealm, exportedPackage);
}
newRealm.importFrom(classRealmManager.getMavenApiRealm(), "");
// org.apache.maven.bridge currently not exposed via Maven Api (3.2.3) but required by API components, e.g
// org.apache.maven.project.DefaultProjectBuilder.
newRealm.importFrom(classRealmManager.getCoreRealm(), "org.apache.maven.bridge");
}
}

Expand Down Expand Up @@ -603,10 +612,13 @@ private ArtifactResolutionResult resolve(MavenSession session, MavenProject proj
final ArtifactResolutionRequest request = new ArtifactResolutionRequest();
request.setResolveRoot(true);
request.setResolveTransitively(true);
request
.setResolutionFilter(new ScopeArtifactFilter(org.apache.maven.artifact.Artifact.SCOPE_RUNTIME_PLUS_SYSTEM));
request
.setCollectionFilter(new ScopeArtifactFilter(org.apache.maven.artifact.Artifact.SCOPE_RUNTIME_PLUS_SYSTEM));

final AndArtifactFilter artifactFilter = new AndArtifactFilter();
artifactFilter.add(new ScopeArtifactFilter(org.apache.maven.artifact.Artifact.SCOPE_RUNTIME_PLUS_SYSTEM));
artifactFilter.add(new ExclusionSetFilter(artifactFilterManager.getCoreArtifactExcludes()));

request.setResolutionFilter(artifactFilter);
request.setCollectionFilter(artifactFilter);

final MavenExecutionRequest executionRequest = session.getRequest();
request.setForceUpdate(executionRequest.isUpdateSnapshots());
Expand Down
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>org.sourcepit</groupId>
<artifactId>srcpit-parent</artifactId>
<version>19</version>
<version>20-SNAPSHOT</version>
</parent>

<groupId>org.sourcepit.tools</groupId>
Expand Down Expand Up @@ -61,17 +61,17 @@
<dependency>
<groupId>org.sourcepit.common.maven</groupId>
<artifactId>common-maven-core</artifactId>
<version>0.21.1</version>
<version>0.22.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.sourcepit.common</groupId>
<artifactId>common-testing</artifactId>
<version>0.12.0</version>
<version>0.13.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.sourcepit.common</groupId>
<artifactId>org.sourcepit.common.utils</artifactId>
<version>0.14.1</version>
<version>0.15.0-SNAPSHOT</version>
</dependency>
</dependencies>
</dependencyManagement>
Expand All @@ -82,7 +82,7 @@
<plugin>
<groupId>org.sourcepit.tools</groupId>
<artifactId>deploy-maven-plugin</artifactId>
<version>0.2.0</version>
<version>0.3.0-SNAPSHOT</version>
</plugin>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself. -->
<plugin>
Expand Down

0 comments on commit a911668

Please sign in to comment.