-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
94 lines (77 loc) · 2.02 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
buildscript {
ext {
springBootVersion = '1.3.5.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'spring-boot'
ext {
generatedDir = 'src/generated'
generatedSourcesDir = "${generatedDir}/java"
}
configurations {
wsimport
}
jar {
baseName = 'spring-boot-jaxws-demo'
version = '0.0.2-SNAPSHOT'
}
sourceCompatibility = 1.7
targetCompatibility = 1.7
repositories {
mavenCentral()
}
ext {
applicationDefaultJvmArgs = [
"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"
]
}
dependencies {
compile 'org.springframework.boot:spring-boot-starter-web'
compile 'javax.xml.ws:jaxws-api:2.2.11'
compile 'com.sun.xml.ws:jaxws-rt:2.2.10'
compile 'com.revinate:jaxws-spring:1.0.0'
wsimport 'com.sun.xml.ws:jaxws-tools:2.2.10'
}
bootRun { task ->
if (project.hasProperty('args')) {
args project.args.split('\\s+')
}
}
task generateSources {
ext.wsdlFile = "src/main/resources/demo/wsdl/DemoService.wsdl"
ext.wsdlLocation = "/demo/wsdl/DemoService.wsdl"
ext.bindingDir = "src/main/resources/demo/xjb"
doLast {
ant {
taskdef name: "wsimport",
classname: "com.sun.tools.ws.ant.WsImport",
classpath: configurations.wsimport.asPath
mkdir(dir: generatedSourcesDir)
wsimport(sourcedestdir: generatedSourcesDir,
wsdl: wsdlFile,
wsdlLocation: wsdlLocation,
keep: true,
xnocompile: true) {
binding(dir: bindingDir, includes: "*.xjb")
}
}
}
}
task cleanGenerated(type: Delete) {
delete generatedDir
}
task wrapper(type: Wrapper) {
gradleVersion = '2.3'
}
clean.dependsOn cleanGenerated
compileJava {
dependsOn generateSources
source generatedSourcesDir
}