From 9255ff9f33ff2fe46e57cf303d6da657d7deec60 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 12 Aug 2022 14:28:37 +0200 Subject: [PATCH] Feature: Manual and auto classpath option - Setting LTS from version 11 to 17 - Fixing jdep call - Updating README.md --- README.md | 5 +++-- warp4j | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 870e382..22a191a 100644 --- a/README.md +++ b/README.md @@ -63,8 +63,8 @@ Turn JAR (java archive) into self-contained executable Options: -j, --java-version override JDK/JRE version - examples: "11", "11.0", "11.0.2", "11.0.2+9" - (default: 11) + examples: "17", "17.0", "17.0.2", "17.0.2+9" + (default: 17) -cp, --class-path adds additional classpaths to the jdeps call -o, --output @@ -104,6 +104,7 @@ Options: Tested on the following operating systems: +- Debian 10.8 - Ubuntu 18.04 - macOS Mojave - Windows Subsystem for Linux with Ubuntu 14.04 diff --git a/warp4j b/warp4j index 41b092f..ded42f1 100755 --- a/warp4j +++ b/warp4j @@ -9,8 +9,8 @@ function print_help { echo 'Options:' echo ' -j, --java-version ' echo ' override JDK/JRE version' - echo ' examples: "11", "11.0", "11.0.2", "11.0.2+9"' - echo ' (default: 11)' + echo ' examples: "17", "17.0", "17.0.2", "17.0.2+9"' + echo ' (default: 17)' echo ' -cp, --class-path ' echo ' adds additional classpaths to the jdeps call' echo ' -o, --output ' @@ -235,7 +235,7 @@ if [[ $JVM_IMPL ]] && fail_with "jvm implementation \"$JVM_IMPL\" is not correct" fi -LATEST_LTS=11 # latest LTS java branch +LATEST_LTS=17 # latest LTS java branch # default options test -z $JAVA_VERSION && JAVA_VERSION=$LATEST_LTS @@ -640,16 +640,16 @@ if [[ $JAVA_DISTRO_TYPE == $DISTRO_TYPE_JDK ]]; then # TODO If JAVA_VERSION is not an INT it will throw an error if [ -n "$CLASS_PATH" ] then - 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) + echo "Using given classpaths: $CLASS_PATH" + MODULES=$($JDEPS --class-path=$CLASS_PATH --print-module-deps --ignore-missing-deps --multi-release $JAVA_VERSION_BASE $JAR | grep -v Warning) elif [ "$SPRING_BOOT" ] then - echo "Extracting jar file to get classpath" - unzip -q "${JAR}" -d "${EXTRACTED_JAR_PATH}" - 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) + echo "Extracting jar file to get classpath" + unzip -q "${JAR}" -d "${EXTRACTED_JAR_PATH}" + echo "Fetching modules" + 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 - 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) fi fi