Gradle Script to Generate Java classes from a wsdl using axis 1.6
daniel Mon, 07/22/2013 - 1:40pm
Some Resouces:
This is an update of the gradle build script from a previous post which uses a newer version of axis and gradle:
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'eclipse'
apply plugin: 'maven'
sourceCompatibility = 1.7
version = '1.0.0'
group = 'com.bowerstudios'
jar {
manifest {
attributes 'Implementation-Title': 'MyApp', 'Implementation-Version': version
}
}
repositories {
mavenCentral()
}
configurations {
compile
runtime
axisGenAntTask
}
dependencies {
groovy group: 'org.codehaus.groovy', name: 'groovy', version: '2.0.5'
compile 'log4j:log4j:1.2.16',
'commons-collections:commons-collections:3.2.1',
'commons-codec:commons-codec:1.5'
compile('org.apache.axis2:axis2-adb:1.6.2') //may need to exclude woden
compile 'org.apache.axis2:axis2-transport-local:1.6.2',
'org.apache.axis2:axis2-transport-http:1.6.2'
testCompile group: 'junit', name: 'junit', version: '4.+'
axisGenAntTask 'org.apache.axis2:axis2-ant-plugin:1.6.2'
}
task genWsdlClasses() << {
ant.echo(message:'Generating Classes for use with WSDL')
ant.taskdef(
name: 'genClassesFromWSDL',
classname: 'org.apache.axis2.tool.ant.AntCodegenTask',
classpath: configurations.axisGenAntTask.asPath
)
ant.genClassesFromWSDL(
wsdlfilename: 'https://mywebservice.com/xml/wsdls/OrgInfo.wsdl',
databindingName: 'adb',
allPorts: true,
overWrite: true,
// skipBuildXML: true, // optional
// syncOnly: true, //optional
targetSourceFolderLocation: 'src/main/java',
unpackClasses: true
)
}
- Log in to post comments