Hi all
I have a following snippet in my build.gradle that works fine under Java 8, but fails under Java 11:
configurations {
jaxws
}
dependencies {
jaxws group: 'javax.jws', name: 'javax.jws-api', version: '1.1'
jaxws 'com.sun.xml.ws:jaxws-tools:2.3.0'
}
task wsimportInput {
inputs.dir('src/main/resources/wsdl/input')
outputs.dir('build/generated/wsdl/my/package/wsdl/input')
doFirst {
mkdir 'build/generated/wsdl'
}
doLast {
ant.taskdef(name: 'wsimport',
classname: 'com.sun.tools.ws.ant.WsImport',
classpath: configurations.jaxws.asPath)
ant.wsimport(
wsdl: 'src/main/resources/wsdl/input/myservice.wsdl',
package: 'my.package.wsdl.input',
sourcedestdir: 'build/generated/wsdl',
xnocompile: 'true',
disableAuthenticator: 'true',
xdebug: 'true'
) {
}
}
}
task wsimport() {
dependsOn(wsimportInput)
}
compileJava.dependsOn(wsimport)
So, under Java 8 this works fine and generates necessary classes. However, under Java 11, this is error I am getting:
[ant:wsimport] Caused by: java.io.FileNotFoundException: C:\Users\myname.gradle\daemon\6.4.1\src\main\resources\wsdl\input\myservice.wsdl (The system cannot find th
e path specified)
So, apparently, relative path, specified in Ant task definition, is being turned into wrong absolute path, when run under Java 11. How can I debug/troubleshoot this issue? Which Gradle component is responsible for “absolutizing” relative paths in this case?