forked from spring-projects/spring-ws-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
65 lines (52 loc) · 1.55 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
configurations {
jaxb
}
ext.springVersion = '3.2.4.RELEASE'
ext.springWsVersion = '2.1.4.RELEASE'
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
repositories {
maven { url 'http://repo.spring.io/libs-release' }
}
task genJaxb {
ext.sourcesDir = "${buildDir}/generated-sources/jaxb"
ext.classesDir = "${buildDir}/classes/jaxb"
ext.schema = "http://wsf.cdyne.com/WeatherWS/Weather.asmx?wsdl"
outputs.dir classesDir
doLast() {
project.ant {
taskdef name: "xjc", classname: "com.sun.tools.xjc.XJCTask",
classpath: configurations.jaxb.asPath
mkdir(dir: sourcesDir)
mkdir(dir: classesDir)
xjc(destdir: sourcesDir, schema: schema,
package: "org.springframework.ws.samples.weather") {
arg(value: "-wsdl")
produces(dir: sourcesDir, includes: "**/*.java")
}
javac(destdir: classesDir, source: 1.6, target: 1.6, debug: true,
debugLevel: "lines,vars,source",
classpath: configurations.jaxb.asPath) {
src(path: sourcesDir)
include(name: "**/*.java")
include(name: "*.java")
}
copy(todir: classesDir) {
fileset(dir: sourcesDir, erroronmissingdir: false) {
exclude(name: "**/*.java")
}
}
}
}
}
dependencies {
compile("org.springframework.ws:spring-ws-core:$springWsVersion")
compile(files(genJaxb.classesDir).builtBy(genJaxb))
runtime("log4j:log4j:1.2.16")
jaxb "com.sun.xml.bind:jaxb-xjc:2.1.7"
}
task runClient(dependsOn: 'classes', type:JavaExec) {
main = "org.springframework.ws.samples.weather.WeatherClient"
classpath = sourceSets.main.runtimeClasspath
}