You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2026/06/14 20:03:18 UTC

(maven-jmod-plugin) branch master updated (4a13ba6 -> fb44e10)

This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/maven-jmod-plugin.git


    from 4a13ba6  Fix jmod-plugin ITs for Maven 4.0.0-rc-5 compatibility (#106)
     new edaa328  Bump org.codehaus.plexus:plexus-java from 1.0.3 to 1.5.2
     new fb44e10  Enhance JModCreateMojo to handle .jmod files in classpath and stabilize class/module-path entries

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 pom.xml                                            |  2 +-
 .../apache/maven/plugins/jmod/JModCreateMojo.java  | 27 ++++++++++++++++++++--
 2 files changed, 26 insertions(+), 3 deletions(-)


(maven-jmod-plugin) 02/02: Enhance JModCreateMojo to handle .jmod files in classpath and stabilize class/module-path entries

Posted by sl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-jmod-plugin.git

commit fb44e100e0cdd43f58b680999afedf3e18a8c6d0
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Sun Jun 14 21:50:59 2026 +0200

    Enhance JModCreateMojo to handle .jmod files in classpath and stabilize class/module-path entries
---
 .../apache/maven/plugins/jmod/JModCreateMojo.java  | 27 ++++++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/jmod/JModCreateMojo.java b/src/main/java/org/apache/maven/plugins/jmod/JModCreateMojo.java
index 11f39b8..2d426b1 100644
--- a/src/main/java/org/apache/maven/plugins/jmod/JModCreateMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jmod/JModCreateMojo.java
@@ -25,6 +25,7 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
 
@@ -453,8 +454,13 @@ public class JModCreateMojo extends AbstractJModMojo {
                 }
 
                 for (File file : resolvePathsResult.getClasspathElements()) {
-                    getLog().debug("classpathElements: File: " + file.getPath());
-                    classpathElements.add(file.getPath());
+                    if (isJmodFile(file)) {
+                        // jmod create does not accept .jmod artifacts on --class-path.
+                        addModulePathElement(file);
+                    } else {
+                        getLog().debug("classpathElements: File: " + file.getPath());
+                        classpathElements.add(file.getPath());
+                    }
                 }
 
                 for (File file : resolvePathsResult.getModulepathElements().keySet()) {
@@ -476,6 +482,23 @@ public class JModCreateMojo extends AbstractJModMojo {
                 classpathElements.add(file.getPath());
             }
         }
+
+        // Keep class/module-path entries stable and unique while preserving order.
+        classpathElements = new ArrayList<>(new LinkedHashSet<>(classpathElements));
+        modulepathElements = new ArrayList<>(new LinkedHashSet<>(modulepathElements));
+    }
+
+    private boolean isJmodFile(File file) {
+        return file.isFile() && file.getName().endsWith(".jmod");
+    }
+
+    private void addModulePathElement(File file) {
+        getLog().debug("modulepathElements (from classpath jmod): File: " + file.getPath());
+        if (file.isDirectory()) {
+            modulepathElements.add(file.getPath());
+        } else {
+            modulepathElements.add(file.getParent());
+        }
     }
 
     private Commandline createJModCreateCommandLine(File resultingJModFile) {


(maven-jmod-plugin) 01/02: Bump org.codehaus.plexus:plexus-java from 1.0.3 to 1.5.2

Posted by sl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-jmod-plugin.git

commit edaa328010a342a13c4187d77b2b255f035e88bb
Author: dependabot[bot] <49...@users.noreply.github.com>
AuthorDate: Sun Jun 14 18:43:35 2026 +0000

    Bump org.codehaus.plexus:plexus-java from 1.0.3 to 1.5.2
    
    Bumps [org.codehaus.plexus:plexus-java](https://github.com/codehaus-plexus/plexus-languages) from 1.0.3 to 1.5.2.
    - [Release notes](https://github.com/codehaus-plexus/plexus-languages/releases)
    - [Commits](https://github.com/codehaus-plexus/plexus-languages/compare/plexus-languages-1.0.3...plexus-languages-1.5.2)
    
    ---
    updated-dependencies:
    - dependency-name: org.codehaus.plexus:plexus-java
      dependency-version: 1.5.2
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <su...@github.com>
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 2b03cd3..360f0ff 100644
--- a/pom.xml
+++ b/pom.xml
@@ -102,7 +102,7 @@
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-java</artifactId>
-      <version>1.0.3</version>
+      <version>1.5.2</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.shared</groupId>