Skip to content

Commit afbb5c8

Browse files
committed
Specify JDK version. (#520)
1 parent 5b16094 commit afbb5c8

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

build.gradle

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ subprojects {
3030
'commons_compress': '1.21',
3131
'guava': '29.0-jre',
3232
'jackson_databind': '2.15.1',
33+
'jdk': '8',
3334
'junit': '4.12',
3435
'mockito': '2.27.0',
3536
'slf4j': '1.7.36',
@@ -82,8 +83,17 @@ subprojects {
8283
check.dependsOn(editorconfigChecker)
8384
check.dependsOn(javadoc)
8485

85-
sourceCompatibility = 1.8
86-
targetCompatibility = 1.8
86+
java {
87+
toolchain {
88+
languageVersion = JavaLanguageVersion.of(versions.jdk)
89+
}
90+
}
91+
92+
tasks.withType(JavaExec) {
93+
javaLauncher = javaToolchains.launcherFor {
94+
languageVersion = java.toolchain.languageVersion
95+
}
96+
}
8797

8898
tasks.withType(JavaCompile) {
8999
'all -processing -rawtypes -serial'.split().each {

settings.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
* limitations under the License.
1515
*/
1616

17+
plugins {
18+
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'
19+
}
20+
1721
rootProject.name = 'metafacture-core'
1822

1923
include ':metafacture-commons'

0 commit comments

Comments
 (0)