You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Java11+ container depends on the java agent project. To compile it, need a compatible JDK version:
101
-
// lower bound 11 and upper bound imageJavaVersion
102
-
task validateJavaHome {
103
-
def requiredForVer = ["11", "17", "21"]
104
-
if (requiredForVer.contains(imageJavaVersion)) {
105
-
doFirst {
106
-
if (JavaVersion.VERSION_1_8.compareTo(JavaVersion.current()) <0) {
107
-
return
108
-
}
109
-
boolean propertyFound =false
110
-
// enable to build agent with compatible java versions (11-requiredForVer)
111
-
for (defcheckVer : requiredForVer) {
112
-
if (project.hasProperty("java${checkVer}Home")) {
113
-
propertyFound =true
114
-
}
115
-
if (checkVer == imageJavaVersion) {
116
-
// cannot build agent with a higher version than the docker java ver
117
-
break
118
-
}
119
-
}
120
-
if (!propertyFound) {
121
-
thrownewGradleException("System Java needs to have version 11+ or java${imageJavaVersion}Home required for imageJavaVersion=${imageJavaVersion}. Re-run with -Pjava${imageJavaVersion}Home")
0 commit comments