Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions apache-maven/src/assembly/component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,25 @@ under the License.
<useProjectArtifact>false</useProjectArtifact>
<outputDirectory>boot</outputDirectory>
<includes>
<include>org.codehaus.plexus:plexus-classworlds</include>
<include>org.apache.maven:maven-api-classworlds</include>
<include>org.apache.maven:maven-classworlds</include>
</includes>
</dependencySet>

<dependencySet>
<useProjectArtifact>false</useProjectArtifact>
<outputDirectory>lib/modules</outputDirectory>
<includes>
<include>org.jline:*</include>
</includes>
</dependencySet>

<dependencySet>
<useProjectArtifact>false</useProjectArtifact>
<outputDirectory>lib</outputDirectory>
<excludes>
<exclude>org.codehaus.plexus:plexus-classworlds</exclude>
<exclude>org.apache.maven:maven-api-classworlds</exclude>
<exclude>org.apache.maven:maven-classworlds</exclude>
</excludes>
Comment on lines 39 to 45
</dependencySet>
</dependencySets>
Expand Down
2 changes: 2 additions & 0 deletions apache-maven/src/assembly/maven/bin/m2.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ main is ${maven.mainClass} from plexus.core
set maven.conf default ${maven.home}/conf
set maven.installation.conf default ${maven.conf}

module ${maven.home}/lib/modules/*.jar

[plexus.core]
load ${maven.conf}/logging
optionally ${maven.home}/lib/ext/redisson/*.jar
Expand Down
23 changes: 20 additions & 3 deletions apache-maven/src/assembly/maven/bin/mvn
Original file line number Diff line number Diff line change
Expand Up @@ -226,17 +226,34 @@ fi
if [ -n "$MAVEN_DEBUG_SCRIPT" ]; then
echo "[DEBUG] Final MAVEN_OPTS: $MAVEN_OPTS" >&2
fi
LAUNCHER_JAR=`echo "$MAVEN_HOME"/boot/plexus-classworlds-*.jar`
LAUNCHER_JAR=""
for _jar in "$MAVEN_HOME"/boot/*.jar; do
[ -f "$_jar" ] && LAUNCHER_JAR="${LAUNCHER_JAR:+$LAUNCHER_JAR:}$_jar"
done
LAUNCHER_CLASS=org.codehaus.plexus.classworlds.launcher.Launcher
MODULES_DIR="$MAVEN_HOME/lib/modules"

# Module-path and native access flags require a JDK that can read the module jars.
# The probe includes --module-path so it fails on JDKs that cannot read the module descriptors.
USE_MODULE_PATH=false
if "$JAVACMD" --module-path "$MODULES_DIR" --add-modules ALL-MODULE-PATH --enable-native-access=org.jline.terminal.ffm -version >/dev/null 2>&1; then
USE_MODULE_PATH=true
fi

# For Cygwin and MinGW, switch paths to Windows format before running java(1) command
if $cygwin || $mingw ; then
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --windows "$JAVA_HOME"`
LAUNCHER_JAR=`cygpath --windows "$LAUNCHER_JAR"`
LAUNCHER_JAR=`cygpath --windows --path "$LAUNCHER_JAR"`
CLASSWORLDS_CONF=`cygpath --windows "$CLASSWORLDS_CONF"`
MAVEN_HOME=`cygpath --windows "$MAVEN_HOME"`
MAVEN_PROJECTBASEDIR=`cygpath --windows "$MAVEN_PROJECTBASEDIR"`
MODULES_DIR=`cygpath --windows "$MODULES_DIR"`
fi

MAVEN_MODULE_OPTS=""
if $USE_MODULE_PATH; then
MAVEN_MODULE_OPTS="--module-path \"$MODULES_DIR\" --add-modules ALL-MODULE-PATH --enable-native-access=org.jline.terminal.ffm,org.jline.nativ"
fi

handle_args() {
Expand Down Expand Up @@ -279,7 +296,7 @@ MAVEN_MAIN_CLASS=${MAVEN_MAIN_CLASS:=org.apache.maven.cling.MavenCling}
cmd="\"$JAVACMD\" \
$MAVEN_OPTS \
$MAVEN_DEBUG_OPTS \
--enable-native-access=ALL-UNNAMED \
$MAVEN_MODULE_OPTS \
-classpath \"$LAUNCHER_JAR\" \
\"-Dclassworlds.conf=$CLASSWORLDS_CONF\" \
\"-Dmaven.home=$MAVEN_HOME\" \
Expand Down
15 changes: 12 additions & 3 deletions apache-maven/src/assembly/maven/bin/mvn.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -266,21 +266,30 @@ goto processArgs
:endHandleArgs
call :processArgs %*

for %%i in ("%MAVEN_HOME%"\boot\plexus-classworlds-*) do set LAUNCHER_JAR="%%i"
set LAUNCHER_JAR="%MAVEN_HOME%\boot\*"
set LAUNCHER_CLASS=org.codehaus.plexus.classworlds.launcher.Launcher
set MODULES_DIR="%MAVEN_HOME%\lib\modules"
if "%MAVEN_MAIN_CLASS%"=="" @set MAVEN_MAIN_CLASS=org.apache.maven.cling.MavenCling

@rem Module-path and native access flags require a JDK that can read the module jars.
@rem The probe includes --module-path so it fails on JDKs that cannot read the module descriptors.
set MAVEN_MODULE_OPTS=
"%JAVACMD%" --module-path %MODULES_DIR% --add-modules ALL-MODULE-PATH --enable-native-access=org.jline.terminal.ffm -version >NUL 2>&1
if not ERRORLEVEL 1 (
set MAVEN_MODULE_OPTS=--module-path %MODULES_DIR% --add-modules ALL-MODULE-PATH --enable-native-access=org.jline.terminal.ffm,org.jline.nativ
)

if defined MAVEN_DEBUG_SCRIPT (
echo [DEBUG] Launching JVM with command:
echo [DEBUG] "%JAVACMD%" %INTERNAL_MAVEN_OPTS% %MAVEN_OPTS% %JVM_CONFIG_MAVEN_OPTS% %MAVEN_DEBUG_OPTS% --enable-native-access=ALL-UNNAMED -classpath %LAUNCHER_JAR% "-Dclassworlds.conf=%CLASSWORLDS_CONF%" "-Dmaven.home=%MAVEN_HOME%" "-Dmaven.mainClass=%MAVEN_MAIN_CLASS%" "-Dlibrary.jline.path=%MAVEN_HOME%\lib\jline-native" "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %LAUNCHER_CLASS% %MAVEN_ARGS% %*
echo [DEBUG] "%JAVACMD%" %INTERNAL_MAVEN_OPTS% %MAVEN_OPTS% %JVM_CONFIG_MAVEN_OPTS% %MAVEN_DEBUG_OPTS% %MAVEN_MODULE_OPTS% -classpath %LAUNCHER_JAR% "-Dclassworlds.conf=%CLASSWORLDS_CONF%" "-Dmaven.home=%MAVEN_HOME%" "-Dmaven.mainClass=%MAVEN_MAIN_CLASS%" "-Dlibrary.jline.path=%MAVEN_HOME%\lib\jline-native" "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %LAUNCHER_CLASS% %MAVEN_ARGS% %*
)

"%JAVACMD%" ^
%INTERNAL_MAVEN_OPTS% ^
%MAVEN_OPTS% ^
%JVM_CONFIG_MAVEN_OPTS% ^
%MAVEN_DEBUG_OPTS% ^
--enable-native-access=ALL-UNNAMED ^
%MAVEN_MODULE_OPTS% ^
-classpath %LAUNCHER_JAR% ^
"-Dclassworlds.conf=%CLASSWORLDS_CONF%" ^
"-Dmaven.home=%MAVEN_HOME%" ^
Expand Down
6 changes: 5 additions & 1 deletion apache-maven/src/main/appended-resources/META-INF/LICENSE.vm
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,13 @@ subject to the terms and conditions of the following licenses:
#* *##end ##
#* *###
#* *### Classworlds is in boot directory, not in lib
#* *##if ( $project.artifact.artifactId == "plexus-classworlds" )
#* *##if ( $project.artifact.artifactId == "maven-classworlds" )
#* *##set ( $directory = 'boot' ) ##
#* *##end ##
#* *### JLine modules are in lib/modules directory
#* *##if ( $groupId == "org.jline" )
#* *##set ( $directory = 'lib/modules' ) ##
#* *##end ##
#* *###
#* *### copy license file to lib/$artifactId.license
#* *##set ( $licFile = $directory + '/' + $project.artifact.artifactId + '.license' ) ##
Expand Down
39 changes: 39 additions & 0 deletions api/maven-api-classworlds/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.maven</groupId>
<artifactId>maven-api</artifactId>
<version>4.1.0-SNAPSHOT</version>
</parent>

<artifactId>maven-api-classworlds</artifactId>
<name>Maven 4 API :: Classworlds</name>
<description>Maven 4 API for class loading realms and isolation.</description>

<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-api-annotations</artifactId>
</dependency>
</dependencies>

</project>
Loading
Loading