From 39c0ad9b9d5198864e329f0666359bbf3b4837f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9da=20Housni=20Alaoui?= Date: Mon, 13 Jan 2025 19:04:54 +0100 Subject: [PATCH] Fix build failure --- .github/workflows/ci.yaml | 2 +- src/it/test1/pom.xml | 4 +-- .../maven/osgi/dp/AbstractDpMojo.java | 28 ++++++++----------- 3 files changed, 14 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 912fbfe..16bc738 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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 diff --git a/src/it/test1/pom.xml b/src/it/test1/pom.xml index 22c87ed..eb66efc 100644 --- a/src/it/test1/pom.xml +++ b/src/it/test1/pom.xml @@ -8,8 +8,8 @@ pom - 0.25.0 - 0.25.0 + 1.1.0 + 1.1.0 diff --git a/src/main/java/de/dentrassi/maven/osgi/dp/AbstractDpMojo.java b/src/main/java/de/dentrassi/maven/osgi/dp/AbstractDpMojo.java index 3611c11..45b1b7b 100644 --- a/src/main/java/de/dentrassi/maven/osgi/dp/AbstractDpMojo.java +++ b/src/main/java/de/dentrassi/maven/osgi/dp/AbstractDpMojo.java @@ -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; @@ -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; @@ -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 projectRepos; + @Parameter(defaultValue = "${repositorySystemSession}", readonly = true, required = true) private RepositorySystemSession repositorySession; @@ -96,9 +100,6 @@ public abstract class AbstractDpMojo extends AbstractMojo { @Component protected MavenProjectHelper projectHelper; - @Component - private DependencyResolver dependencyResolver; - private final Set tychoWalkerProjects = new HashSet<>(Arrays.asList("eclipse-feature")); @Component(role = TychoProject.class) @@ -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 remoteRepositories; - /** * An optional explicit version *

@@ -236,10 +228,12 @@ protected void fillfromExtraDependencies(final Manifest manifest, final Map result = this.resolver.resolveArtifacts(this.repositorySession, requests); + final List result = this.repoSystem.resolveArtifacts(this.repositorySession, requests); for (final ArtifactResult ares : result) { getLog().debug("Additional dependency: " + ares);