Hi Ken,
Am 29.08.10 05:22, schrieb Kenneth Kousen:
Thanks for the reply. That's very helpful.
I see now how to tie into the basic process, but I still have a
question. I hadn't realized there was a wsimport ant task. I tried
to configure it this way:
You can get further informations about the ant task at
https://jax-ws.dev.java.net/nonav/2.1.1/docs/wsimportant.html
task wsimport(dependsOn: JavaPlugin.PROCESS_RESOURCES_TASK_NAME) {
doLast{
ant.taskdef(name:'wsimport',
classname:'com.sun.tools.ws.ant.WsImport')
ant.wsimport(keep:true,
destdir: sourceSets.main.classesDir,
sourcedestdir: sourceSets.main.java.srcDirs,
wsdl:'...url of wsdl file...')
}
}
compileJava.dependsOn(wsimport)
But the result I get is:
"taskdef class com.sun.tools.ws.ant.WsImport cannot be found
using the classloader AntClassLoader[]"
I was going to start playing with dependencies for JAX-WS, but
wsimport is already part of JDK 1.6. How do I tell Gradle where to
find it?
In the article mentioned above there is a special chapter about running
wsimport using jdk1.6. I'm not sure if the ant task is part of the jdk.
but you can add the jaxb-tools jar to your classpath by the following:
--------------
...
...
repositories {
mavenCentral() //add central maven repo to your buildfile
}
configurations{
jaxws //add a specific configuration, used to run your specific
wsimport ant task
}
dependencies{
jaxws "com.sun.xml.ws:jaxws-tools:2.1EA1" //add jaxws-tools
(version 2.1EA1) to the jaxws configuration
}
task wsimport(dependsOn: JavaPlugin.PROCESS_RESOURCES_TASK_NAME) {
doLast{
//define your ant task by referring to the jaxws configuration
ant.taskdef(name:'wsimport',
classname:'com.sun.tools.ws.ant.WsImport',
classpath:configurations.jaxws.asPath)
}
...
}
....
--------------
regards,
René
--
------------------------------------
Rene Groeschke
[email protected]
http://www.breskeby.com
http://twitter.com/breskeby
------------------------------------