aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2019-05-14 15:15:48 -0500
committerSonarTech <sonartech@sonarsource.com>2019-05-16 20:21:09 +0200
commit4b3f7d6e87338e17d2554d21b3f3253ab36fe4b6 (patch)
tree8777ddda761fdc00560d0f20d371e21cc1b63543
parent74cbdd7c043e8e9ee51d7c18aeef86db386df136 (diff)
downloadsonarqube-4b3f7d6e87338e17d2554d21b3f3253ab36fe4b6.tar.gz
sonarqube-4b3f7d6e87338e17d2554d21b3f3253ab36fe4b6.zip
Build with Java 11
-rw-r--r--build.gradle10
1 files changed, 9 insertions, 1 deletions
diff --git a/build.gradle b/build.gradle
index 2109a921608..ca2214ab1b0 100644
--- a/build.gradle
+++ b/build.gradle
@@ -44,6 +44,11 @@ sonarqube {
}
}
+
+if (!JavaVersion.current().java11Compatible) {
+ throw new GradleException("JDK 11+ is required to perform this build. It's currently " + System.getProperty("java.home") + ".")
+}
+
allprojects {
apply plugin: 'com.jfrog.artifactory'
apply plugin: 'maven-publish'
@@ -246,7 +251,10 @@ subprojects {
exclude group: 'javax.mail', module: 'mail'
}
- sourceCompatibility = 1.8
+ compileJava {
+ options.compilerArgs.addAll(['--release', '8'])
+ }
+
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}