Skip to content

Commit

Permalink
fix JavaScopes visibility to RUNTIME for standalone and maven mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jetoile committed Nov 1, 2017
1 parent 668e4bf commit 3f2749e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ public void run() {

RepositorySystem system = newRepositorySystem();
DefaultRepositorySystemSession session = newRepositorySystemSession(system);
DependencyFilter classpathFilter = DependencyFilterUtils.classpathFilter(JavaScopes.COMPILE);
DependencyFilter classpathFilter = DependencyFilterUtils.classpathFilter(JavaScopes.RUNTIME);

components.stream().forEach(
c -> {
Artifact artifact = new DefaultArtifact(c.getArtifact());

ArtifactRequest request = new ArtifactRequest();
CollectRequest collectRequest = new CollectRequest();
collectRequest.setRoot(new Dependency(artifact, JavaScopes.COMPILE));
collectRequest.setRoot(new Dependency(artifact, JavaScopes.RUNTIME));
collectRequest.setRepositories(remoteRepos);

log.info("Resolving artifact " + artifact + " from " + remoteRepos.stream().map(r -> r.getId() + "-" + r.getUrl()).collect(Collectors.joining(", ")));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.eclipse.aether.transport.http.HttpTransporterFactory;
import org.eclipse.aether.util.artifact.JavaScopes;
import org.eclipse.aether.util.filter.DependencyFilterUtils;
import org.fusesource.jansi.AnsiConsole;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -124,12 +125,12 @@ public static void main(String[] args) throws BootstrapException, MalformedURLEx

RepositorySystem system = newRepositorySystem();
DefaultRepositorySystemSession session = newRepositorySystemSession(system);
DependencyFilter classpathFilter = DependencyFilterUtils.classpathFilter(JavaScopes.COMPILE);
DependencyFilter classpathFilter = DependencyFilterUtils.classpathFilter(JavaScopes.RUNTIME);

componentsToStart.stream().forEach(c -> {
Artifact artifact = new DefaultArtifact(hadoopUnitConfiguration.getString(c.getArtifactKey()));
CollectRequest collectRequest = new CollectRequest();
collectRequest.setRoot(new Dependency(artifact, JavaScopes.COMPILE));
collectRequest.setRoot(new Dependency(artifact, JavaScopes.RUNTIME));
collectRequest.setRepositories(newRepositories(system, session));

DependencyRequest dependencyRequest = new DependencyRequest(collectRequest, classpathFilter);
Expand Down

0 comments on commit 3f2749e

Please sign in to comment.