Skip to content

Commit

Permalink
Fix build failure
Browse files Browse the repository at this point in the history
  • Loading branch information
reda-alaoui authored and ctron committed Jan 14, 2025
1 parent cade4fc commit 39c0ad9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
run: mvn -B test

- name: Run integration tests
run: mvn -B verify -Pits
run: mvn -B verify -Pits -Dinvoker.streamLogs
4 changes: 2 additions & 2 deletions src/it/test1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<packaging>pom</packaging>

<properties>
<tycho-version>0.25.0</tycho-version>
<tycho-extras-version>0.25.0</tycho-extras-version>
<tycho-version>1.1.0</tycho-version>
<tycho-extras-version>1.1.0</tycho-extras-version>
</properties>

<modules>
Expand Down
28 changes: 11 additions & 17 deletions src/main/java/de/dentrassi/maven/osgi/dp/AbstractDpMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import java.util.jar.JarFile;
import java.util.jar.JarOutputStream;
import java.util.jar.Manifest;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.model.Dependency;
import org.apache.maven.plugin.AbstractMojo;
Expand All @@ -50,13 +49,12 @@
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.graph.DefaultDependencyNode;
import org.eclipse.aether.impl.ArtifactResolver;
import org.eclipse.aether.repository.RemoteRepository;
import org.eclipse.aether.resolution.ArtifactRequest;
import org.eclipse.aether.resolution.ArtifactResolutionException;
import org.eclipse.aether.resolution.ArtifactResult;
import org.eclipse.aether.util.artifact.JavaScopes;
import org.eclipse.tycho.ReactorProject;
import org.eclipse.tycho.core.DependencyResolver;
import org.eclipse.tycho.core.TychoProject;
import org.osgi.framework.Version;

Expand All @@ -74,6 +72,12 @@ public abstract class AbstractDpMojo extends AbstractMojo {
@Component
private RepositorySystem repoSystem;

/**
* The project's remote repositories to use for the resolution of project dependencies.
*/
@Parameter(defaultValue = "${project.remoteProjectRepositories}", readonly = true)
private List<RemoteRepository> projectRepos;

@Parameter(defaultValue = "${repositorySystemSession}", readonly = true, required = true)
private RepositorySystemSession repositorySession;

Expand All @@ -96,9 +100,6 @@ public abstract class AbstractDpMojo extends AbstractMojo {
@Component
protected MavenProjectHelper projectHelper;

@Component
private DependencyResolver dependencyResolver;

private final Set<String> tychoWalkerProjects = new HashSet<>(Arrays.asList("eclipse-feature"));

@Component(role = TychoProject.class)
Expand All @@ -110,15 +111,6 @@ public abstract class AbstractDpMojo extends AbstractMojo {
@Parameter
private Dependency[] additionalDependencies;

@Component
private ArtifactResolver resolver;

@Parameter(property = "localRepository", readonly = true)
private ArtifactRepository localRepository;

@Parameter(property = "project.remoteArtifactRepositories", readonly = true)
private List<ArtifactRepository> remoteRepositories;

/**
* An optional explicit version
* <p>
Expand Down Expand Up @@ -236,10 +228,12 @@ protected void fillfromExtraDependencies(final Manifest manifest, final Map<Stri
dep.getClassifier(), dep.getType(), dep.getVersion());
final org.eclipse.aether.graph.Dependency adep = new org.eclipse.aether.graph.Dependency(art,
JavaScopes.RUNTIME);
requests.add(new ArtifactRequest(new DefaultDependencyNode(adep)));
DefaultDependencyNode node = new DefaultDependencyNode(adep);
node.setRepositories(projectRepos);
requests.add(new ArtifactRequest(node));
}

final List<ArtifactResult> result = this.resolver.resolveArtifacts(this.repositorySession, requests);
final List<ArtifactResult> result = this.repoSystem.resolveArtifacts(this.repositorySession, requests);

for (final ArtifactResult ares : result) {
getLog().debug("Additional dependency: " + ares);
Expand Down

0 comments on commit 39c0ad9

Please sign in to comment.