Skip to content

Instantly share code, notes, and snippets.

@ae6rt
Created February 8, 2014 12:56
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save ae6rt/8883335 to your computer and use it in GitHub Desktop.
Save ae6rt/8883335 to your computer and use it in GitHub Desktop.
Gradle build snippet to generate Java from WSDL
configurations {
jaxws
}
dependencies {
jaxws 'com.sun.xml.ws:jaxws-tools:2.1.4'
}
task wsimport {
ext.destDir = file("${projectDir}/src/main/generated")
doLast {
ant {
sourceSets.main.output.classesDir.mkdirs()
destDir.mkdirs()
taskdef(name: 'wsimport',
classname: 'com.sun.tools.ws.ant.WsImport',
classpath: configurations.jaxws.asPath
)
wsimport(keep: true,
destdir: sourceSets.main.output.classesDir,
sourcedestdir: destDir,
extension: "true",
verbose: "false",
quiet: "false",
package: "com.example.client.api",
xnocompile: "true",
wsdl: 'src/main/resources/api.wsdl') {
xjcarg(value: "-XautoNameResolution")
}
}
}
}
compileJava {
dependsOn wsimport
source wsimport.destDir
}
@RobustRoutine
Copy link

what is the command to generate files
or using sts how could i generate using this code....?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment