apply plugin: 'java-library' apply plugin: 'eclipse' apply plugin: 'java-library-distribution' jar { manifest { attributes 'Implementation-Title': 'PDF-AS-4 MOA Library', 'JARMANIFEST': 'PDF-AS-LIB' } } buildscript { repositories { mavenLocal() mavenCentral() } dependencies { classpath("commons-io:commons-io:2.15.1") } } sourceSets { main { java { srcDirs = [ 'src/main/java', 'src/generated/java' ] } } } configurations { ws pdfDoclet { extendsFrom compile } } project.ext { wsdlDir = file("src/main/resources/wsdl") generatedWsdlDir = file("src/generated/java") wsdlsToGenerate = [ ['-xjc', "$wsdlDir/MOA-SPSS-2.0.0.wsdl"], ] } repositories { mavenLocal() mavenCentral() } dependencies { implementation project (':pdf-as-lib') implementation group: 'org.slf4j', name: 'slf4j-api', version: slf4jVersion implementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1' testImplementation group: 'junit', name: 'junit', version: '4.+' ws group: 'org.apache.cxf', name: 'cxf-tools', version: cxfVersion ws group: 'org.apache.cxf', name: 'cxf-tools-wsdlto-databinding-jaxb', version: cxfVersion ws group: 'org.apache.cxf', name: 'cxf-tools-wsdlto-frontend-jaxws', version: cxfVersion api group: 'javax.xml.ws', name: 'jaxws-api', version: '2.3.1' api group: 'javax.jws', name: 'javax.jws-api', version: '1.1' api group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '2.3.3'} task wsdl2Java() { if (!wsdlDir.listFiles()) { // do nothing } else { inputs.files wsdlDir.listFiles() outputs.files generatedWsdlDir doLast { wsdlsToGenerate.each { argsin -> argsin.add(argsin.size - 1, '-d') argsin.add(argsin.size - 1, generatedWsdlDir) argsin.add(argsin.size - 1, '-wsdlLocation') argsin.add(argsin.size - 1, '/wsdl/MOA-SPSS-2.0.0.wsdl') javaexec { classpath configurations.ws main = 'org.apache.cxf.tools.wsdlto.WSDLToJava' args = argsin systemProperties = ['exitOnFinish':'TRUE'] } } } } } task releases(type: Copy) { from jar.outputs into rootDir.toString() + "/releases/" + version } releases.dependsOn jar releases.dependsOn sourcesJar test { systemProperties 'property': 'value' }