This is an automated email from the ASF dual-hosted git repository.
mbuenger pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-jmod-plugin.git
The following commit(s) were added to refs/heads/master by this push:
new 3cf5df5 Add check if JMOD-Folder exists (#92)
3cf5df5 is described below
commit 3cf5df523b71920ab750425340fcc8bc81800d10
Author: Matthias Bünger <[email protected]>
AuthorDate: Sun Dec 28 12:11:23 2025 +0100
Add check if JMOD-Folder exists (#92)
The JMOD folder is not part of the OpenJDK since Java 24 due JEP 493.
Some vendors still add the folder, but some do not.
This PR adds a check to throw an exception if the JMOD folder does not
exist.
Also adds information to site.
---
.../apache/maven/plugins/jmod/JModCreateMojo.java | 5 ++++
src/site/apt/index.apt.vm | 5 ++--
src/site/markdown/jep493.md | 31 ++++++++++++++++++++++
src/site/site.xml | 1 +
4 files changed, 39 insertions(+), 3 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 8697253..11f39b8 100644
--- a/src/main/java/org/apache/maven/plugins/jmod/JModCreateMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jmod/JModCreateMojo.java
@@ -296,6 +296,11 @@ public class JModCreateMojo extends AbstractJModMojo {
getLog().debug("Parent: " + javaHome.getAbsolutePath());
getLog().debug("jmodsFolder: " + jmodsFolderJDK.getAbsolutePath());
+ if (!jmodsFolderJDK.exists()) {
+ throw new IOException(
+ "JMODS folder does not exists. You might use a JDK
which does not ship this anymore due to JEP 493 (Java 24). For more information
also see: https://openjdk.org/jeps/493");
+ }
+
preparePaths();
failIfParametersAreNotInTheirValidValueRanges();
diff --git a/src/site/apt/index.apt.vm b/src/site/apt/index.apt.vm
index adec95d..f11fd69 100644
--- a/src/site/apt/index.apt.vm
+++ b/src/site/apt/index.apt.vm
@@ -30,9 +30,6 @@ ${project.name}
The JMod Plugin is used to create {{{http://openjdk.java.net/jeps/261}JMod
Files}}.
- NOTE: This is an alpha release which means everything can change until we
reach the first
- milestone release.
-
* Goals Overview
The JMod Plugin has currently two goals:
@@ -52,6 +49,8 @@ ${project.name}
General instructions on how to use the JMod Plugin can be found on the
{{{./usage.html}usage page}}. Some more
specific use cases are described in the examples given below.
+ <<Java 24+ Users:>> Please be aware of the changes introduced with
{{{./jep493.html}JEP 493}}!
+
In case you still have questions regarding the plugin's usage, please have a
look at the {{{./faq.html}FAQ}} and feel
free to contact the {{{./mailing-lists.html}user mailing list}}. The posts
to the mailing list are archived and could
already contain the answer to your question as part of an older thread.
Hence, it is also worth browsing/searching
diff --git a/src/site/markdown/jep493.md b/src/site/markdown/jep493.md
new file mode 100644
index 0000000..9f39d3a
--- /dev/null
+++ b/src/site/markdown/jep493.md
@@ -0,0 +1,31 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# JEP 493: Linking Run-Time Images without JMODs
+
+Java 24 introduced ["JEP 493: Linking Run-Time Images without
JMODs"](https://openjdk.org/jeps/493).
+Goal of this JEP is to reduce JDK size by about 25%, by removing the JDK's own
JMOD files.
+This means that since Java 24 each JDK vendor decides if they support the new
option or ship the JMOD files.
+For example the [Eclipse Temurin
JDK](https://adoptium.net/news/2025/08/eclipse-temurin-jdk24-JEP493-enabled)
does not ship these files anymore since Java 24.
+
+The Maven JMod Plugin depends on the existence of the `/jmods` folder of the
used JDK (configured via `JAVA_HOME`) and will fail if this directory does not
exist.
+If you want to use the Maven JMod Plugin make sure to either use a JDK which
still ships the JDK's own JMOD files natively or try to download them in
addition to the JDK.
+
+In the long term the JDK team suggest to link run-time images without JMODs as
introduced in the JEP.
+
diff --git a/src/site/site.xml b/src/site/site.xml
index 8d87ca0..e683fd0 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -29,6 +29,7 @@ under the License.
<!-- According to https://issues.apache.org/jira/browse/MNGSITE-152 -->
<item name="License" href="https://www.apache.org/licenses/"/>
<item name="Download" href="download.html"/>
+ <item name="JEP 493: Linking Run-Time Images Without JMODs"
href="jep493.html"/>
</menu>
<menu name="Examples">
<item name="Describe Goal" href="examples/example-describe.html"/>