Feature: Manual and auto classpath option

- Setting LTS from version 11 to 17
- Fixing jdep call
- Updating README.md
This commit is contained in:
david 2022-08-12 14:28:37 +02:00
parent 7037c6a791
commit 9255ff9f33
2 changed files with 13 additions and 12 deletions

View File

@ -63,8 +63,8 @@ Turn JAR (java archive) into self-contained executable
Options: Options:
-j, --java-version <version> -j, --java-version <version>
override JDK/JRE version override JDK/JRE version
examples: "11", "11.0", "11.0.2", "11.0.2+9" examples: "17", "17.0", "17.0.2", "17.0.2+9"
(default: 11) (default: 17)
-cp, --class-path <classpath> -cp, --class-path <classpath>
adds additional classpaths to the jdeps call adds additional classpaths to the jdeps call
-o, --output <directory> -o, --output <directory>
@ -104,6 +104,7 @@ Options:
Tested on the following operating systems: Tested on the following operating systems:
- Debian 10.8
- Ubuntu 18.04 - Ubuntu 18.04
- macOS Mojave - macOS Mojave
- Windows Subsystem for Linux with Ubuntu 14.04 - Windows Subsystem for Linux with Ubuntu 14.04

10
warp4j
View File

@ -9,8 +9,8 @@ function print_help {
echo 'Options:' echo 'Options:'
echo ' -j, --java-version <version>' echo ' -j, --java-version <version>'
echo ' override JDK/JRE version' echo ' override JDK/JRE version'
echo ' examples: "11", "11.0", "11.0.2", "11.0.2+9"' echo ' examples: "17", "17.0", "17.0.2", "17.0.2+9"'
echo ' (default: 11)' echo ' (default: 17)'
echo ' -cp, --class-path <classpath>' echo ' -cp, --class-path <classpath>'
echo ' adds additional classpaths to the jdeps call' echo ' adds additional classpaths to the jdeps call'
echo ' -o, --output <directory>' echo ' -o, --output <directory>'
@ -235,7 +235,7 @@ if [[ $JVM_IMPL ]] &&
fail_with "jvm implementation \"$JVM_IMPL\" is not correct" fail_with "jvm implementation \"$JVM_IMPL\" is not correct"
fi fi
LATEST_LTS=11 # latest LTS java branch LATEST_LTS=17 # latest LTS java branch
# default options # default options
test -z $JAVA_VERSION && JAVA_VERSION=$LATEST_LTS test -z $JAVA_VERSION && JAVA_VERSION=$LATEST_LTS
@ -641,13 +641,13 @@ if [[ $JAVA_DISTRO_TYPE == $DISTRO_TYPE_JDK ]]; then
if [ -n "$CLASS_PATH" ] if [ -n "$CLASS_PATH" ]
then then
echo "Using given classpaths: $CLASS_PATH" echo "Using given classpaths: $CLASS_PATH"
MODULES=$("$JDEPS" -cp $CLASS_PATH --print-module-deps --ignore-missing-deps --multi-release $JAVA_VERSION_BASE "$JAR" | grep -v Warning) MODULES=$($JDEPS --class-path=$CLASS_PATH --print-module-deps --ignore-missing-deps --multi-release $JAVA_VERSION_BASE $JAR | grep -v Warning)
elif [ "$SPRING_BOOT" ] elif [ "$SPRING_BOOT" ]
then then
echo "Extracting jar file to get classpath" echo "Extracting jar file to get classpath"
unzip -q "${JAR}" -d "${EXTRACTED_JAR_PATH}" unzip -q "${JAR}" -d "${EXTRACTED_JAR_PATH}"
echo "Fetching modules" echo "Fetching modules"
MODULES=$("$JDEPS" -classpath \'${EXTRACTED_JAR_PATH}/BOOT-INF/lib/*:${EXTRACTED_JAR_PATH}/BOOT-INF/classes:${EXTRACTED_JAR_PATH}\' --print-module-deps --ignore-missing-deps --module-path ${EXTRACTED_JAR_PATH}/BOOT-INF/lib/javax.activation-api-1.2.0.jar --recursive --multi-release ${JAVA_VERSION_BASE} -quiet ${EXTRACTED_JAR_PATH}/org ${EXTRACTED_JAR_PATH}/BOOT-INF/classes ${EXTRACTED_JAR_PATH}/BOOT-INF/lib/*.jar | grep -v Warning) MODULES=$($JDEPS --ignore-missing-deps --print-module-deps --recursive --multi-release $JAVA_VERSION_BASE -quiet --class-path=${EXTRACTED_JAR_PATH}/BOOT-INF/lib/* --module-path=${EXTRACTED_JAR_PATH}/BOOT-INF/lib/BOOT-INF/lib/* $JAR | grep -v Warning)
else else
echo "Fetch modules with default behavior" echo "Fetch modules with default behavior"
MODULES=$("$JDEPS" --print-module-deps --ignore-missing-deps --multi-release $JAVA_VERSION_BASE "$JAR" | grep -v Warning) MODULES=$("$JDEPS" --print-module-deps --ignore-missing-deps --multi-release $JAVA_VERSION_BASE "$JAR" | grep -v Warning)