Skip to content

Commit

Permalink
Move away of deprecated Aether API
Browse files Browse the repository at this point in the history
  • Loading branch information
akurtakov committed May 27, 2024
1 parent 61408d3 commit 8ef8dd1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,13 @@
import org.eclipse.aether.artifact.Artifact;
import org.eclipse.aether.collection.CollectRequest;
import org.eclipse.aether.graph.Dependency;
import org.eclipse.aether.graph.DependencyFilter;
import org.eclipse.aether.graph.DependencyNode;
import org.eclipse.aether.graph.DependencyVisitor;
import org.eclipse.aether.impl.SyncContextFactory;
import org.eclipse.aether.repository.RemoteRepository;
import org.eclipse.aether.resolution.ArtifactRequest;
import org.eclipse.aether.resolution.ArtifactResolutionException;
import org.eclipse.aether.resolution.DependencyRequest;
import org.eclipse.aether.spi.synccontext.SyncContextFactory;
import org.eclipse.core.runtime.Platform;
import org.eclipse.m2e.pde.target.shared.ProcessingMessage.Type;
import org.osgi.framework.Constants;
Expand Down Expand Up @@ -104,21 +103,17 @@ public static WrappedBundle getWrappedArtifact(Artifact artifact,

DependencyRequest dependencyRequest = new DependencyRequest();
dependencyRequest.setRoot(node);
dependencyRequest.setFilter(new DependencyFilter() {

@Override
public boolean accept(DependencyNode node, List<DependencyNode> parents) {
ArtifactRequest request = new ArtifactRequest();
request.setRepositories(repositories);
Artifact nodeArtifact = node.getArtifact();
request.setArtifact(nodeArtifact);
try {
repoSystem.resolveArtifact(repositorySession, request);
} catch (ArtifactResolutionException e) {
return false;
}
return true;
dependencyRequest.setFilter((node1, parents) -> {
ArtifactRequest request = new ArtifactRequest();
request.setRepositories(repositories);
Artifact nodeArtifact = node1.getArtifact();
request.setArtifact(nodeArtifact);
try {
repoSystem.resolveArtifact(repositorySession, request);
} catch (ArtifactResolutionException e) {
return false;
}
return true;
});
repoSystem.resolveDependencies(repositorySession, dependencyRequest);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
import org.eclipse.aether.artifact.Artifact;
import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.graph.DependencyNode;
import org.eclipse.aether.impl.SyncContextFactory;
import org.eclipse.aether.repository.RemoteRepository;
import org.eclipse.aether.spi.synccontext.SyncContextFactory;
import org.eclipse.equinox.internal.p2.publisher.eclipse.FeatureParser;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
import org.apache.maven.repository.RepositorySystem;
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.Requirement;
import org.eclipse.aether.impl.SyncContextFactory;
import org.eclipse.aether.spi.synccontext.SyncContextFactory;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.tycho.core.MavenDependenciesResolver;
import org.eclipse.tycho.core.resolver.shared.IncludeSourceMode;
import org.eclipse.tycho.core.shared.MavenContext;
import org.eclipse.tycho.targetplatform.TargetDefinitionContent;
import org.eclipse.tycho.targetplatform.TargetDefinition.MavenGAVLocation;
import org.eclipse.tycho.targetplatform.TargetDefinitionContent;

@Component(role = MavenTargetLocationFactory.class)
public class MavenTargetLocationFactory {
Expand Down

0 comments on commit 8ef8dd1

Please sign in to comment.