This is an automated email from the ASF dual-hosted git repository. rzo1 pushed a commit to branch tomee-10.x in repository https://gitbox.apache.org/repos/asf/tomee.git
commit 9ddb8cc02298be69b223cf96256e690aa16956cb Author: Richard Zowalla <[email protected]> AuthorDate: Sun Sep 20 20:16:40 2026 +0200 TOMEE-4705 migrate the Maven plugins off the Maven 2 API maven.version was still 2.2.1, so every plugin compiled and resolved against Maven 2 artifacts even though the project itself requires Maven 3.9.x. It moves to 3.9.16. maven-project does not exist beyond Maven 2. MavenProject and MavenProjectHelper live in maven-core now, so the five modules that used it depend on maven-core instead. tomee-maven-plugin, tomee-embedded-maven-plugin and jarstxt-maven-plugin also use ArtifactFactory, ArtifactResolver and the ArtifactRepository types around them, which Maven 3 keeps in maven-compat, so they take that as well. Dropping Maven 2 also drops backport-util-concurrent, which it pulled in transitively. JarsTxtMojo and JsCustomizertest imported edu.emory.mathcs.backport.java.util.Collections, a Java 1.4 era backport of java.util.concurrent, and now use java.util.Collections. The cast in JarsTxtMojo went with it, since java.util.Collections.singleton is generic. The aether-api entry is removed too. Nothing declares it and no source imports org.sonatype.aether; Maven 3.1 moved to Eclipse Aether, and the resolver arrives through maven-core now. All eight modules build and their tests pass. No org.apache.maven artifact below 3.9.16 is left in any of their dependency trees. (cherry picked from commit 0a7d1b0afec9d4979eb7811076b8652df916ef4b) --- maven/applicationcomposer-maven-plugin/pom.xml | 2 +- maven/jarstxt-maven-plugin/pom.xml | 6 +++++- .../org/apache/openejb/maven/jarstxt/JarsTxtMojo.java | 4 ++-- maven/openejb-embedded-maven-plugin/pom.xml | 2 +- maven/pom.xml | 16 +++++++++------- maven/tomee-embedded-maven-plugin/pom.xml | 6 +++++- maven/tomee-maven-plugin/pom.xml | 6 +++++- .../openejb/maven/plugin/test/JsCustomizertest.java | 2 +- 8 files changed, 29 insertions(+), 15 deletions(-) diff --git a/maven/applicationcomposer-maven-plugin/pom.xml b/maven/applicationcomposer-maven-plugin/pom.xml index a76fe12cbc..6628edab62 100644 --- a/maven/applicationcomposer-maven-plugin/pom.xml +++ b/maven/applicationcomposer-maven-plugin/pom.xml @@ -36,7 +36,7 @@ </dependency> <dependency> <groupId>org.apache.maven</groupId> - <artifactId>maven-project</artifactId> + <artifactId>maven-core</artifactId> </dependency> <dependency> <groupId>org.apache.tomee</groupId> diff --git a/maven/jarstxt-maven-plugin/pom.xml b/maven/jarstxt-maven-plugin/pom.xml index 06daf87356..82cd800122 100644 --- a/maven/jarstxt-maven-plugin/pom.xml +++ b/maven/jarstxt-maven-plugin/pom.xml @@ -36,7 +36,11 @@ Licensed to the Apache Software Foundation (ASF) under one or more </dependency> <dependency> <groupId>org.apache.maven</groupId> - <artifactId>maven-project</artifactId> + <artifactId>maven-core</artifactId> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-compat</artifactId> </dependency> <dependency> <groupId>org.apache.maven.plugin-tools</groupId> diff --git a/maven/jarstxt-maven-plugin/src/main/java/org/apache/openejb/maven/jarstxt/JarsTxtMojo.java b/maven/jarstxt-maven-plugin/src/main/java/org/apache/openejb/maven/jarstxt/JarsTxtMojo.java index 8d77ce182e..88af567320 100644 --- a/maven/jarstxt-maven-plugin/src/main/java/org/apache/openejb/maven/jarstxt/JarsTxtMojo.java +++ b/maven/jarstxt-maven-plugin/src/main/java/org/apache/openejb/maven/jarstxt/JarsTxtMojo.java @@ -16,7 +16,6 @@ */ package org.apache.openejb.maven.jarstxt; -import edu.emory.mathcs.backport.java.util.Collections; import org.apache.commons.lang3.text.StrLookup; import org.apache.commons.lang3.text.StrSubstitutor; import org.apache.maven.artifact.Artifact; @@ -45,6 +44,7 @@ import java.io.FileWriter; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -128,7 +128,7 @@ public class JarsTxtMojo extends AbstractMojo { throw new MojoExecutionException(e.getMessage(), e); } final File file = artifact.getFile(); - line.append("|").append(Files.hash((Set<URL>) Collections.singleton(file.toURI().toURL()), hashAlgo)) + line.append("|").append(Files.hash(Collections.singleton(file.toURI().toURL()), hashAlgo)) .append("|").append(hashAlgo); } diff --git a/maven/openejb-embedded-maven-plugin/pom.xml b/maven/openejb-embedded-maven-plugin/pom.xml index a617616115..00346138bb 100644 --- a/maven/openejb-embedded-maven-plugin/pom.xml +++ b/maven/openejb-embedded-maven-plugin/pom.xml @@ -36,7 +36,7 @@ </dependency> <dependency> <groupId>org.apache.maven</groupId> - <artifactId>maven-project</artifactId> + <artifactId>maven-core</artifactId> </dependency> <dependency> <groupId>org.apache.tomee</groupId> diff --git a/maven/pom.xml b/maven/pom.xml index 51d2d5d27d..fb9aa12702 100644 --- a/maven/pom.xml +++ b/maven/pom.xml @@ -30,7 +30,7 @@ <name>TomEE :: Maven Plugins</name> <properties> - <maven.version>2.2.1</maven.version> + <maven.version>3.9.16</maven.version> </properties> <modules> @@ -61,24 +61,26 @@ <version>${maven.version}</version> </dependency> <dependency> + <!-- MavenProject and MavenProjectHelper, which lived in maven-project under Maven 2 --> <groupId>org.apache.maven</groupId> - <artifactId>maven-project</artifactId> + <artifactId>maven-core</artifactId> <version>${maven.version}</version> </dependency> <dependency> + <!-- ArtifactFactory, ArtifactResolver and the ArtifactRepository types they need --> <groupId>org.apache.maven</groupId> - <artifactId>maven-core</artifactId> + <artifactId>maven-compat</artifactId> <version>${maven.version}</version> </dependency> <dependency> <groupId>org.apache.maven</groupId> - <artifactId>maven-artifact</artifactId> + <artifactId>maven-core</artifactId> <version>${maven.version}</version> </dependency> <dependency> - <groupId>org.sonatype.aether</groupId> - <artifactId>aether-api</artifactId> - <version>${version.aether}</version> + <groupId>org.apache.maven</groupId> + <artifactId>maven-artifact</artifactId> + <version>${maven.version}</version> </dependency> <dependency> <groupId>org.apache.tomee</groupId> diff --git a/maven/tomee-embedded-maven-plugin/pom.xml b/maven/tomee-embedded-maven-plugin/pom.xml index 6d31fb76a1..71456f0d68 100644 --- a/maven/tomee-embedded-maven-plugin/pom.xml +++ b/maven/tomee-embedded-maven-plugin/pom.xml @@ -37,7 +37,11 @@ </dependency> <dependency> <groupId>org.apache.maven</groupId> - <artifactId>maven-project</artifactId> + <artifactId>maven-core</artifactId> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-compat</artifactId> </dependency> <dependency> <groupId>org.apache.tomee</groupId> diff --git a/maven/tomee-maven-plugin/pom.xml b/maven/tomee-maven-plugin/pom.xml index 5f24ee4f34..1bb2d0eeba 100644 --- a/maven/tomee-maven-plugin/pom.xml +++ b/maven/tomee-maven-plugin/pom.xml @@ -37,7 +37,11 @@ </dependency> <dependency> <groupId>org.apache.maven</groupId> - <artifactId>maven-project</artifactId> + <artifactId>maven-core</artifactId> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-compat</artifactId> </dependency> <dependency> <groupId>org.apache.tomee</groupId> diff --git a/maven/tomee-maven-plugin/src/test/java/org/apache/openejb/maven/plugin/test/JsCustomizertest.java b/maven/tomee-maven-plugin/src/test/java/org/apache/openejb/maven/plugin/test/JsCustomizertest.java index 1d0c556771..76fd20ae30 100644 --- a/maven/tomee-maven-plugin/src/test/java/org/apache/openejb/maven/plugin/test/JsCustomizertest.java +++ b/maven/tomee-maven-plugin/src/test/java/org/apache/openejb/maven/plugin/test/JsCustomizertest.java @@ -16,13 +16,13 @@ */ package org.apache.openejb.maven.plugin.test; -import edu.emory.mathcs.backport.java.util.Collections; import org.apache.openejb.maven.plugin.Config; import org.apache.openejb.maven.plugin.TomEEMavenPluginRule; import org.junit.Rule; import org.junit.Test; import java.io.File; +import java.util.Collections; import java.util.List; import java.util.zip.ZipFile;
