Groovy DEF methods doesn’t work in latest gradle 8.1.1 ?
def copyPolicyExportJarsToJDK() {
def doneFile = file(MARKER_DIR.absolutePath + "/JCE_POLICIES_COPY.done")
if (!doneFile.exists()) {
if(hasProperty('JCE_POLICY_ZIP') && JCE_POLICY_ZIP) {
def zipFile = file(JCE_POLICY_ZIP)
copy {
from zipTree(zipFile).files
into JAVA_HOME + File.separator + "jre" + File.separator + "lib" + File.separator + "security"
include '/*.jar'
}
doneFile.createNewFile()
} else {
println "JCE_POLICY_ZIP variable not set. Will not attempt to copy the policy jars to JDK"
}
}
}
Build failed:
> Could not find method copyPolicyExportJarsToJDK() for arguments [build_e67cth4ldo02nu8qt7t68alvl$_run_closure39@16c1c268] on root project 'otest' of type org.gradle.api.Project.