Created
August 26, 2014 07:21
-
-
Save janisz/96e3bcb07c8d6f3d5ae5 to your computer and use it in GitHub Desktop.
wsdl2java
This file contains 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
repositories.mavenCentral() | |
configurations { wsdl } | |
dependencies { | |
wsdl 'org.apache.axis:axis:1.4' | |
wsdl 'commons-logging:commons-logging:1.1.1' | |
wsdl 'javax.xml:jaxrpc:1.1' | |
wsdl 'commons-discovery:commons-discovery:0.2' | |
wsdl 'javax.xml.soap:saaj-api:1.3.5' | |
wsdl 'wsdl4j:wsdl4j:1.4' | |
wsdl 'javax.activation:activation:1.1' | |
wsdl 'javax.mail:mail:1.4' | |
} | |
task wsdl2java { | |
ext { | |
outputDir = file("$buildDir/generated-src/java/") | |
} | |
outputs.dir outputDir | |
description = 'Generate Java Classes' | |
[ | |
'http://first/wsdl/address', | |
'http://second/wsdl/address', | |
'http://third/wsdl/address' | |
].each { String url -> | |
doLast { | |
println url | |
javaexec { | |
classpath configurations.wsdl | |
main = 'org.apache.axis.wsdl.WSDL2Java' | |
args = [url, | |
'--NStoPkg=' + 'namespace/to/convert/1=desired.package', | |
'--NStoPkg=' + 'namespace/to/convert/2=desired.package', | |
'--NStoPkg=' + 'namespace/to/convert/3=desired.package', | |
'--verbose', | |
'--all', | |
"--output=$outputDir"] | |
} | |
} | |
} | |
} | |
compileJava.source wsdl2java.outputs.files, sourceSets.main.java |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment