-
Notifications
You must be signed in to change notification settings - Fork 24
/
build.gradle
executable file
·75 lines (56 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
66
67
68
69
70
71
72
73
74
75
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.4.0.RELEASE")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'spring-boot'
sourceSets.main.java.srcDirs += "${buildDir}/generated-sources/jaxb"
// tag::xsd[]
task genJaxb {
ext.sourcesDir = "${buildDir}/generated-sources/jaxb"
ext.schema = "src/main/resources/translator.xsd"
inputs.file ext.schema
outputs.dir ext.sourcesDir
doFirst() {
project.ant {
taskdef name: "xjc", classname: "com.sun.tools.xjc.XJCTask",
classpath: configurations.jaxb.asPath
mkdir(dir: sourcesDir)
xjc(destdir: sourcesDir, schema: schema, encoding: 'UTF-8') {
arg(value: "-wsdl")
produces(dir: sourcesDir, includes: "**/*.java")
}
}
}
}
// end::xsd[]
task afterEclipseImport {
dependsOn "genJaxb"
}
compileJava.dependsOn genJaxb
// tag::jaxb[]
configurations {
jaxb
}
repositories {
mavenCentral()
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
compile "org.springframework.boot:spring-boot-starter-web-services"
compile "org.apache.httpcomponents:httpclient:4.5.2"
compile "wsdl4j:wsdl4j:1.6.3"
jaxb "com.sun.xml.bind:jaxb-core:2.2.11"
jaxb "com.sun.xml.bind:jaxb-xjc:2.2.11"
testCompile "org.springframework.boot:spring-boot-starter-test"
}
task wrapper(type: Wrapper) {
gradleVersion = '2.7'
}