Skip to content

Commit

Permalink
Merge pull request #337 from rundeck/issue/331
Browse files Browse the repository at this point in the history
Fix #331 java 11 illegal access warnings
  • Loading branch information
gschueler authored Sep 29, 2020
2 parents d6c68b8 + 6f9c6f6 commit ba6fab6
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions rd-cli-tool/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ dependencies {
}
shadowJar {
mergeServiceFiles()
manifest {
attributes(
['Add-Opens':'java.base/java.lang.invoke']
)
}
}

//force distZip/distTar artifacts to be overwritten by shadow versions
Expand Down Expand Up @@ -98,6 +103,14 @@ set -e
RD_CONF=${RD_CONF:-$HOME/.$APP_NAME/$APP_NAME.conf}
test -f $RD_CONF && . $RD_CONF
export RD_EXT_DIR=${RD_EXT_DIR:-$HOME/.$APP_NAME/ext}
'''
)
def setJ11AddOpens=appendConfigData.curry(
'^APP_ARGS=.*$',
'''
if $JAVACMD --add-opens 2>&1 | grep 'requires modules' >/dev/null; then
JAVA_OPTS="$JAVA_OPTS --add-opens=java.base/java.lang.invoke=ALL-UNNAMED"
fi
'''
)

Expand All @@ -111,9 +124,8 @@ export RD_EXT_DIR=${RD_EXT_DIR:-$HOME/.$APP_NAME/ext}
.readLines()
.collect(setE)
.collect(setClasspath)
.collect(setJ11AddOpens)
.join('\n')

//TODO: modify windows start script to load config
}

}
Expand Down

0 comments on commit ba6fab6

Please sign in to comment.