-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
123 lines (100 loc) · 3.38 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "com.avast.gradle:docker-compose-gradle-plugin:0.3.8"
}
}
plugins {
id "war"
id "eclipse-wtp"
id "com.intershop.gradle.jaxb" version "1.0.1"
}
apply plugin: 'docker-compose'
configurations {
xjc
}
repositories {
jcenter()
}
dependencies {
def jerseyVersion = "2.23.2"
providedCompile "javax.servlet:javax.servlet-api:3.1.+"
providedCompile group: 'javax.servlet.jsp', name: 'jsp-api', version: '2.2'
compile group: 'javax.servlet', name: 'jstl', version: '1.2'
compile "org.hibernate:hibernate-core:5.2.2.Final"
compile "net.sourceforge.stripes:stripes:1.6.+"
runtime "org.postgresql:postgresql:9.4.1209"
compile group: 'commons-lang', name: 'commons-lang', version: '2.6'
compile group: 'org.glassfish.jersey.containers', name: 'jersey-container-servlet', version: jerseyVersion
compile group: 'org.glassfish.jersey.containers', name: 'jersey-container-servlet-core', version: jerseyVersion
compile group: 'org.glassfish.jersey.media', name: 'jersey-media-json-jackson', version: jerseyVersion
// jaxb dependencies
compile group: 'org.jvnet.hyperjaxb3', name: 'hyperjaxb3-ejb-runtime', version: '0.6.1'
xjc group: 'org.jvnet.hyperjaxb3', name: 'hyperjaxb3-ejb-plugin', version: '0.6.1'
}
jaxb {
javaGen {
//generates a 'project' schema file from existing java code
osst {
schema = file('xsd/Schnittstelle_OSST.xsd')
binding = file('xsd/bindings.xjb')
extension = true
packageName="com.deutschebahn.osst.v1_0"
args = ["-Xhyperjaxb3-jpa2", "-Xhyperjaxb3-jpa2-persistenceXml=xsd/persistence.xml"]
}
}
}
def hyperjaxb3MetaInfAdditions = 'build/generated/jaxb/java/osst'
war {
classpath hyperjaxb3MetaInfAdditions
}
eclipse.wtp {
component {
contextPath = '/'
// prevent automatic downgrading on eclipse import which causes some wb-resources to be dropped
// (original value is '2.0')
file {
withXml { xml ->
def node = xml.asNode()
node.@'project-version' = '1.5.0'
}
}
}
facet {
facet name: 'jst.web', version: '3.1'
facet name: 'jst.java', version: '1.8'
}
}
eclipse.classpath.file {
// Classpath entry for Eclipse which changes the order of classpathentries; otherwise no sources for 3rd party jars are shown
withXml { xml ->
def node = xml.asNode()
node.remove( node.find { it.@path == 'org.eclipse.jst.j2ee.internal.web.container' } )
node.appendNode( 'classpathentry', [ kind: 'con', path: 'org.eclipse.jst.j2ee.internal.web.container', exported: 'true'])
}
}
// set utf-8 encoding for eclipse project
eclipseJdt << {
File f = file('.settings/org.eclipse.core.resources.prefs')
f.write('eclipse.preferences.version=1\n')
f.append('encoding/<project>=utf-8')
}
cleanEclipse << {
File f = file('.settings/org.eclipse.core.resources.prefs')
f.delete()
}
dockerCompose {
useComposeFiles = ['docker/docker-compose.yml']
}
task copyToDocker(type: Copy) {
from war.archivePath
into "docker/web/"
rename '(.*).war', 'application.war'
}
copyToDocker.dependsOn war
composeUp.dependsOn copyToDocker
afterEvaluate {
tasks.eclipseClasspath.dependsOn tasks.jaxb
}