Skip to content

Commit b820d27

Browse files
committed
Replace FFM with JLine native module for native access
Switched from using jline-terminal-ffm to jline-native module for native access control. This provides a cleaner approach using JLine's native module instead of the Foreign Function & Memory API. Key changes: - Replaced jline-terminal-ffm dependency with jline-native in apache-maven POM - Updated assembly configuration to include jline-native in modules directory - Modified launcher scripts to use org.jline.nativ module instead of org.jline.terminal.ffm - Updated both Unix and Windows launchers with new module references Benefits: - Uses JLine's dedicated native module instead of FFM approach - Maintains clean module loading without warnings - Provides proper native access control for JLine functionality - Simplifies the module dependency structure
1 parent 0c8e87b commit b820d27

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

apache-maven/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ under the License.
107107
</dependency>
108108
<dependency>
109109
<groupId>org.jline</groupId>
110-
<artifactId>jline-terminal-ffm</artifactId>
110+
<artifactId>jline-native</artifactId>
111111
</dependency>
112112

113113
<!-- (legacy) DI annotations -->

apache-maven/src/assembly/component.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ under the License.
3131
<outputDirectory>modules</outputDirectory>
3232
<includes>
3333
<!-- JLine modules that need native access -->
34-
<include>org.jline:jline-terminal-ffm</include>
34+
<include>org.jline:jline-native</include>
3535
<include>org.jline:jline-terminal-jni</include>
3636
<include>org.jline:jline-terminal</include>
3737
<include>org.jline:jline-reader</include>
@@ -48,7 +48,7 @@ under the License.
4848
<excludes>
4949
<exclude>org.apache.maven:maven-classworlds</exclude>
5050
<!-- Exclude JLine modules that go to modules/ directory -->
51-
<exclude>org.jline:jline-terminal-ffm</exclude>
51+
<exclude>org.jline:jline-native</exclude>
5252
<exclude>org.jline:jline-terminal-jni</exclude>
5353
<exclude>org.jline:jline-terminal</exclude>
5454
<exclude>org.jline:jline-reader</exclude>

apache-maven/src/assembly/maven/bin/mvn

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ fi
109109

110110
MODULE_PATH="$MAVEN_HOME/modules"
111111

112-
if ! "$JAVACMD" --module-path "$MODULE_PATH" --add-modules org.jline.terminal.ffm --enable-native-access=org.jline.terminal.ffm -version >/dev/null 2>&1; then
112+
if ! "$JAVACMD" --module-path "$MODULE_PATH" --add-modules org.jline.nativ --enable-native-access=org.jline.nativ -version >/dev/null 2>&1; then
113113
echo "Error: Apache Maven 4.x requires Java 17 or newer to run." >&2
114114
"$JAVACMD" -version >&2
115115
echo "Please upgrade your Java installation or set JAVA_HOME to point to a compatible JDK." >&2
@@ -245,8 +245,8 @@ cmd="\"$JAVACMD\" \
245245
$MAVEN_OPTS \
246246
$MAVEN_DEBUG_OPTS \
247247
--module-path \"$MODULE_PATH\" \
248-
--add-modules org.jline.terminal.ffm \
249-
--enable-native-access=org.jline.terminal.ffm \
248+
--add-modules org.jline.nativ \
249+
--enable-native-access=org.jline.nativ \
250250
-classpath \"$LAUNCHER_JAR\" \
251251
\"-Dclassworlds.conf=$CLASSWORLDS_CONF\" \
252252
\"-Dmaven.home=$MAVEN_HOME\" \

apache-maven/src/assembly/maven/bin/mvn.cmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ if not exist "%JAVACMD%" (
7777
set MODULE_PATH="%MAVEN_HOME%\modules"
7878

7979
@REM Check Java version by testing the Java 17+ flag
80-
"%JAVACMD%" --module-path %MODULE_PATH% --add-modules org.jline.terminal.ffm --enable-native-access=org.jline.terminal.ffm -version >nul 2>&1
80+
"%JAVACMD%" --module-path %MODULE_PATH% --add-modules org.jline.nativ --enable-native-access=org.jline.nativ -version >nul 2>&1
8181
if ERRORLEVEL 1 (
8282
echo Error: Apache Maven 4.x requires Java 17 or newer to run. >&2
8383
"%JAVACMD%" -version >&2
@@ -259,8 +259,8 @@ if "%MAVEN_MAIN_CLASS%"=="" @set MAVEN_MAIN_CLASS=org.apache.maven.cling.MavenCl
259259
%JVM_CONFIG_MAVEN_OPTS% ^
260260
%MAVEN_DEBUG_OPTS% ^
261261
--module-path %MODULE_PATH% ^
262-
--add-modules org.jline.terminal.ffm ^
263-
--enable-native-access=org.jline.terminal.ffm ^
262+
--add-modules org.jline.nativ ^
263+
--enable-native-access=org.jline.nativ ^
264264
-classpath %LAUNCHER_JAR% ^
265265
"-Dclassworlds.conf=%CLASSWORLDS_CONF%" ^
266266
"-Dmaven.home=%MAVEN_HOME%" ^

its/core-it-suite/src/test/resources/mng-5530-mojo-execution-scope/extension/src/main/java/org/apache/maven/its/mng5530/mojoexecutionscope/extension/TestClassRealmManagerDelegate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535

3636
import javax.inject.Named;
3737

38+
import org.apache.maven.api.classworlds.ClassRealm;
3839
import org.apache.maven.classrealm.ClassRealmManagerDelegate;
3940
import org.apache.maven.classrealm.ClassRealmRequest;
4041
import org.apache.maven.classrealm.ClassRealmRequest.RealmType;
41-
import org.apache.maven.api.classworlds.ClassRealm;
4242

4343
@Named
4444
public class TestClassRealmManagerDelegate implements ClassRealmManagerDelegate {

its/core-it-suite/src/test/resources/mng-5771-core-extensions/repo-src/maven-it-core-extensions-no-descriptor/src/main/java/org/apache/maven/its/core_extensions/TestClassRealmManagerDelegate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
*/
1919
package org.apache.maven.its.core_extensions;
2020

21+
import org.apache.maven.api.classworlds.ClassRealm;
2122
import org.apache.maven.classrealm.ClassRealmManagerDelegate;
2223
import org.apache.maven.classrealm.ClassRealmRequest;
23-
import org.apache.maven.api.classworlds.ClassRealm;
2424
import org.codehaus.plexus.component.annotations.Component;
2525

2626
@Component(role = ClassRealmManagerDelegate.class, hint = "TestClassRealmManagerDelegate")

its/core-it-suite/src/test/resources/mng-5771-core-extensions/repo-src/maven-it-core-extensions/src/main/java/org/apache/maven/its/core_extensions/TestClassRealmManagerDelegate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
*/
1919
package org.apache.maven.its.core_extensions;
2020

21+
import org.apache.maven.api.classworlds.ClassRealm;
2122
import org.apache.maven.classrealm.ClassRealmManagerDelegate;
2223
import org.apache.maven.classrealm.ClassRealmRequest;
23-
import org.apache.maven.api.classworlds.ClassRealm;
2424
import org.codehaus.plexus.component.annotations.Component;
2525

2626
@Component(role = ClassRealmManagerDelegate.class, hint = "TestClassRealmManagerDelegate")

0 commit comments

Comments
 (0)