-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
54 lines (45 loc) · 1.17 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
plugins {
id 'java'
}
configurations {
jaxb
}
group 'org.personal'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
//JAXB
jaxb (
'com.sun.xml.bind:jaxb-xjc:4.0.2',
'com.sun.xml.bind:jaxb-impl:4.0.2',
'org.glassfish.jaxb:jaxb-runtime:4.0.2'
)
implementation 'javax.xml.bind:jaxb-api:2.3.1'
implementation 'com.sun.xml.bind:jaxb-core:4.0.3'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.2'
}
test {
useJUnitPlatform()
}
task jaxb {
System.setProperty('javax.xml.accessExternalSchema', 'all')
def jaxbTargetDir = file("src/main/java/")
doLast {
jaxbTargetDir.mkdirs()
ant.taskdef(
name: 'xjc',
classname: 'com.sun.tools.xjc.XJCTask',
classpath: configurations.jaxb.asPath
)
ant.jaxbTargetDir = jaxbTargetDir
ant.xjc(
destdir: '${jaxbTargetDir}',
package: 'org.personal.jaxb',
schema: 'src/main/resources/contracts.xsd'
)
}
}
compileJava.dependsOn jaxb