summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannes Rosenögger <123haynes@gmail.com>2019-03-16 12:48:12 +0100
committerHannes Rosenögger <123haynes@gmail.com>2019-03-21 10:36:52 +0100
commit3a52cda095fae55e13a94e42f3c83263454bcadd (patch)
treedb7231f6a2b150cbd99f113ec15897bc06d48292
parent663c87797b7e52d6db06603770d120958c65c0a3 (diff)
Add Java 11 support
This commit installs JAVA 11 and introduces a new ENV variable "LM_JAVA_VERSION". If this variable is set to 11, maven and gradle will use JAVA 11 instead of JAVA 8. If the variable is not set, the license finder will fall back to the default defined in licensefinder/licensefinder which is currently Java 8. This is necessary because JAVA 11 is not fully backwards compatible with JAVA 8. Without this change the license finder will fail for all JAVA 11 projects.
-rw-r--r--CHANGELOG.md4
-rw-r--r--Dockerfile7
-rwxr-xr-xrun.sh12
3 files changed, 22 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0ca0b8a..90ad9e9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
# GitLab License management changelog
+## v1.2.5
+
+- Feature: support Java 11 via an ENV variable (@haynes !26)
+
## v1.2.4
- Fix: support multiple MAVEN_CLI_OPTS options (@haynes !27)
diff --git a/Dockerfile b/Dockerfile
index f21e9e8..c4dac87 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -6,6 +6,13 @@ MAINTAINER GitLab
ARG LICENSE_FINDER_VERSION
ENV LICENSE_FINDER_VERSION $LICENSE_FINDER_VERSION
+# Install JDK 11
+RUN cd /tmp && \
+ wget --quiet --no-cookies --no-check-certificate https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.2%2B9/OpenJDK11U-jdk_x64_linux_hotspot_11.0.2_9.tar.gz -O jdk-11.tgz && \
+ tar xf /tmp/jdk-11.tgz && \
+ mv jdk-11.0.2+9 /usr/lib/jvm/adoptopen_jdk11 && \
+ rm /tmp/jdk-11.tgz
+
RUN npm install npm-install-peers cheerio
# Don't let Rubygem fail with the numerous projects using PG or MySQL, install realpath
diff --git a/run.sh b/run.sh
index 717c368..4b815ac 100755
--- a/run.sh
+++ b/run.sh
@@ -153,11 +153,21 @@ case "$COMMAND" in
if test -f pom.xml ; then
# Install Java Maven dependencies.
+ if [[ ${LM_JAVA_VERSION} = "11" ]]; then
+ JAVA_HOME=/usr/lib/jvm/adoptopen_jdk11
+ elif [[ ${LM_JAVA_VERSION} = "8" ]]; then
+ JAVA_HOME=/usr/lib/jvm/oracle_jdk8
+ fi
mvn install ${MAVEN_CLI_OPTS:--DskipTests}
fi
if test -f build.gradle ; then
- gradle build
+ if [[ ${LM_JAVA_VERSION} = "11" ]]; then
+ JAVA_HOME=/usr/lib/jvm/adoptopen_jdk11
+ elif [[ ${LM_JAVA_VERSION} = "8" ]]; then
+ JAVA_HOME=/usr/lib/jvm/oracle_jdk8
+ fi
+ gradle build
fi
else
echo "Running '${SETUP_CMD[@]}' to install project dependencies..."