Created
February 8, 2014 12:56
-
-
Save ae6rt/8883335 to your computer and use it in GitHub Desktop.
Gradle build snippet to generate Java from WSDL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
what is the command to generate files
or using sts how could i generate using this code....?