beryx / badass-jlink-plugin

Create a custom runtime image of your modular application
https://badass-jlink-plugin.beryx.org
Apache License 2.0
387 stars 27 forks source link

application.applicationDefaultJvmArgs not taking effect in launcher #197

Closed tbnguyen1407 closed 3 years ago

tbnguyen1407 commented 3 years ago

Version:

2.24.1

Problem:

jlink.launcher.jvmArgs does not default to application.applicationDefaultJvmArgs as documented

jvmArgs
  list of JVM arguments to be passed to the java executable.
  defaultValue: the arguments configured in the applicationDefaultJvmArgs property of the application extension

Reproduction:

Original:

git clone https://github.com/beryx-gist/badass-jlink-example
cd badadd-jlink-example
./gradlew clean jlink

Output 1:

~ build/image/bin/hello ~
"$DIR/java" $CDS_JVM_OPTS -Dlogback.configurationFile=./logback.xml -p "$DIR/../app" -m org.beryx.modular.hello/org.beryx.modular.hello.Hello  "$@"

Modification:

~ build.gradle ~
application {
    applicationDefaultJvmArgs = ['-Dlogback.configurationFile=./logback.xml']
}

jlink {
    launcher {
        //jvmArgs = ['-Dlogback.configurationFile=./logback.xml']
    }
}

Output 2 (missing args):

~ build/image/bin/hello ~
"$DIR/java" $CDS_JVM_OPTS  -p "$DIR/../app" -m org.beryx.modular.hello/org.beryx.modular.hello.Hello  "$@"
siordache commented 3 years ago

Fixed in 2.24.2