From 70fbc7c4f72ac4d6584b9c49f514a0b1c9e7a4a5 Mon Sep 17 00:00:00 2001 From: Sandra Parsick Date: Wed, 15 Dec 2021 14:53:31 +0100 Subject: [PATCH] #190 Update Tycho 2.5.0 (#192) * 190: Update Maven to 3.6.3 * 190: Update Java to 11 * #190: fix cause of broken it tests * #190: Update Tycho to 2.5.0 --- .github/workflows/maven.yml | 2 +- pom.xml | 16 +++++------ src/main/java/org/reficio/p2/P2Mojo.java | 27 ++++++++++++------- src/main/java/org/reficio/p2/utils/Utils.java | 2 +- 4 files changed, 27 insertions(+), 20 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index bc9c75cb..72a5f974 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -32,7 +32,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest, windows-latest, macOS-latest ] - java: [ 8, 11, 14 ] + java: [ 11, 14 ] fail-fast: false runs-on: ${{ matrix.os }} diff --git a/pom.xml b/pom.xml index 8602e310..a110f694 100644 --- a/pom.xml +++ b/pom.xml @@ -13,16 +13,16 @@ UTF-8 UTF-8 - 1.8 + 11 ${java.version} ${java.version} - 3.3.9 - 3.3 - 3.3 + 3.6.3 + 3.6.0 + 3.6.0 5.1.2 - 1.7.0 + 2.5.0 1.13.1 1.1.0 @@ -96,11 +96,11 @@ biz.aQute.bndlib 5.3.0 - + org.eclipse.platform org.eclipse.osgi - 3.15.200 + 3.17.100 @@ -496,7 +496,7 @@ ${java.version} true - http://docs.oracle.com/javase/7/docs/api/ + http://docs.oracle.com/javase/11/docs/api/ diff --git a/src/main/java/org/reficio/p2/P2Mojo.java b/src/main/java/org/reficio/p2/P2Mojo.java index 16475ea9..c167a93c 100644 --- a/src/main/java/org/reficio/p2/P2Mojo.java +++ b/src/main/java/org/reficio/p2/P2Mojo.java @@ -18,8 +18,6 @@ */ package org.reficio.p2; -import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.Multimap; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; @@ -29,7 +27,11 @@ import org.apache.maven.plugin.BuildPluginManager; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.logging.Log; -import org.apache.maven.plugins.annotations.*; +import org.apache.maven.plugins.annotations.Component; +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; +import org.apache.maven.plugins.annotations.ResolutionScope; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.PlexusConstants; import org.codehaus.plexus.PlexusContainer; @@ -49,7 +51,11 @@ import org.reficio.p2.publisher.CategoryPublisher; import org.reficio.p2.resolver.eclipse.EclipseResolutionRequest; import org.reficio.p2.resolver.eclipse.impl.DefaultEclipseResolver; -import org.reficio.p2.resolver.maven.*; +import org.reficio.p2.resolver.maven.Artifact; +import org.reficio.p2.resolver.maven.ArtifactResolutionRequest; +import org.reficio.p2.resolver.maven.ArtifactResolutionResult; +import org.reficio.p2.resolver.maven.ArtifactResolver; +import org.reficio.p2.resolver.maven.ResolvedArtifact; import org.reficio.p2.resolver.maven.impl.AetherResolver; import org.reficio.p2.utils.BundleUtils; import org.reficio.p2.utils.JarUtils; @@ -57,17 +63,18 @@ import java.io.File; import java.io.FileOutputStream; -import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; import java.io.OutputStreamWriter; import java.io.Writer; -import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Locale; +import java.util.Map; import java.util.Set; import static java.util.Objects.requireNonNull; @@ -366,7 +373,7 @@ private void processTransitiveArtifacts(P2ArtifactMap resolved private void processFeatures() { // artifacts should already have been resolved by processArtifacts() - Multimap resolvedFeatures = resolveFeatures(); + P2ArtifactMap resolvedFeatures = resolveFeatures(); // then bundle the artifacts including the transitive dependencies (if specified so) log.info("Resolved " + resolvedFeatures.size() + " features"); for (P2Artifact p2Artifact : features) { @@ -407,12 +414,12 @@ private P2ArtifactMap resolveArtifacts(List artifa return resolvedArtifacts; } - private Multimap resolveFeatures() { - Multimap resolvedArtifacts = ArrayListMultimap.create(); + private P2ArtifactMap resolveFeatures() { + P2ArtifactMap resolvedArtifacts = new P2ArtifactMap<>(); for (P2Artifact p2Artifact : features) { logResolving(p2Artifact); ArtifactResolutionResult resolutionResult = resolveArtifact(p2Artifact); - resolvedArtifacts.putAll(p2Artifact, resolutionResult.getResolvedArtifacts()); + resolvedArtifacts.put(p2Artifact, resolutionResult.getResolvedArtifacts()); } return resolvedArtifacts; } diff --git a/src/main/java/org/reficio/p2/utils/Utils.java b/src/main/java/org/reficio/p2/utils/Utils.java index d3e44d8b..d3ebf73f 100644 --- a/src/main/java/org/reficio/p2/utils/Utils.java +++ b/src/main/java/org/reficio/p2/utils/Utils.java @@ -26,7 +26,7 @@ public class Utils { private static final String JAR_SNAPSHOT_POSTFIX = "-SNAPSHOT"; private static final String OSGI_SNAPSHOT_POSTFIX = ".SNAPSHOT"; private static final String ECLIPSE_QUALIFIER_POSTFIX = ".qualifier"; - public static final String TYCHO_VERSION = "1.7.0"; + public static final String TYCHO_VERSION = "2.5.0"; public static String getTimeStamp() { SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");