This is an automated email from the ASF dual-hosted git repository.
rzo1 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomee.git
The following commit(s) were added to refs/heads/main by this push:
new 0a7d1b0afe TOMEE-4705 migrate the Maven plugins off the Maven 2 API
0a7d1b0afe is described below
commit 0a7d1b0afec9d4979eb7811076b8652df916ef4b
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.
---
maven/applicationcomposer-maven-plugin/pom.xml | 2 +-
maven/jarstxt-maven-plugin/pom.xml | 6 +++++-
.../java/org/apache/openejb/maven/jarstxt/JarsTxtMojo.java | 4 ++--
maven/openejb-embedded-maven-plugin/pom.xml | 2 +-
maven/pom.xml | 14 ++++++++------
maven/tomee-embedded-maven-plugin/pom.xml | 6 +++++-
maven/tomee-maven-plugin/pom.xml | 6 +++++-
.../apache/openejb/maven/plugin/test/JsCustomizertest.java | 2 +-
8 files changed, 28 insertions(+), 14 deletions(-)
diff --git a/maven/applicationcomposer-maven-plugin/pom.xml
b/maven/applicationcomposer-maven-plugin/pom.xml
index 9126bbb117..216c7ecb21 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 237072037e..80fd46f805 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 c3d16b4dae..77c3ffa3d2 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 5a84d60c18..a27de877e5 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,19 +61,21 @@
<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-artifact</artifactId>
+ <artifactId>maven-compat</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 4da77ba073..90c4df11f3 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 aa3b13be15..172d01032d 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;