-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
150 lines (99 loc) · 4.66 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
group 'studies'
version 'v1'
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'war'
sourceCompatibility = 1.8
def hibernateVersion = '5.2.5.Final'
def springVersion = '4.3.7.RELEASE'
def databindVersion = '2.8.7'
def slf4jVersion = '1.7.21'
def log4jVersion = '1.2.17.redhat-1'
def servletVersion = '3.0.1'
def h2Version = '1.4.193'
def thymeleafVersion = '3.0.6.RELEASE'
def aspectjVersion = '1.8.10'
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
// https://mvnrepository.com/artifact/org.hibernate/hibernate-core
compile group: 'org.hibernate', name: 'hibernate-core', version: "${hibernateVersion}"
// // https://mvnrepository.com/artifact/org.thymeleaf/thymeleaf
// compile group: 'org.thymeleaf', name: 'thymeleaf', version: "${thymeleafVersion}"
//
// // https://mvnrepository.com/artifact/org.thymeleaf/thymeleaf-spring4
// compile group: 'org.thymeleaf', name: 'thymeleaf-spring4', version: "${thymeleafVersion}"
// https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: "${databindVersion}"
// https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jaFckson-core
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: "${databindVersion}"
// https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations
compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: "${databindVersion}"
// https://mvnrepository.com/artifact/org.slf4j/slf4j-api
compile group: 'org.slf4j', name: 'slf4j-api', version: "${slf4jVersion}"
// https://mvnrepository.com/artifact/org.slf4j/slf4j-log4j12
compile group: 'org.slf4j', name: 'slf4j-log4j12', version: "${slf4jVersion}"
// https://mvnrepository.com/artifact/log4j/log4j
compile group: 'log4j', name: 'log4j', version: "${log4jVersion}"
// https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api
// let's try to start using java-configs over xml-configs
compile group: 'javax.servlet', name: 'javax.servlet-api', version: "${servletVersion}"
compile group: 'org.springframework', name: 'spring-beans', version: "${springVersion}"
// https://mvnrepository.com/artifact/org.springframework/spring-webmvc
compile group: 'org.springframework', name: 'spring-webmvc', version: "${springVersion}"
compile group: 'com.h2database', name: 'h2', version: "${h2Version}"
// https://mvnrepository.com/artifact/org.mockito/mockito-core
compile group: 'org.mockito', name: 'mockito-core', version: '2.2.11'
// https://mvnrepository.com/artifact/org.springframework/spring-test
compile group: 'org.springframework', name: 'spring-test', version: '4.3.2.RELEASE'
// https://mvnrepository.com/artifact/org.springframework/spring-aop
compile group: 'org.springframework', name: 'spring-aop', version: "${springVersion}"
// https://mvnrepository.com/artifact/org.aspectj/aspectjrt
compile group: 'org.aspectj', name: 'aspectjrt', version: "${aspectjVersion}"
// https://mvnrepository.com/artifact/org.aspectj/aspectjweaver
compile group: 'org.aspectj', name: 'aspectjweaver', version: "${aspectjVersion}"
}
def tomcatHomeLocal = '/opt/tomcat/apache-tomcat-8.5.11'
def shortName = 'sbattle'
//task deployLocal(type: Copy, dependsOn: ['buildWar']) {
task deployLocal(type: Copy, dependsOn: war) {
description = "Deploys the module to local web-container"
mustRunAfter "undeployLocal"
// from war.archivePath
from "${buildDir}/libs/"
into "${tomcatHomeLocal}/webapps"
include "*.war"
def warname = "${project.name}-${version}"
rename { String fileName ->
fileName.replace("${warname}.war", "${shortName}.war")
}
doLast {
println "Deploying application locally"
}
}
task undeployLocal(type: Delete) {
description = "Undeploys module from the local web-container"
def warname = "${shortName}"
doLast {
println "Undeploying application locally"
file("${tomcatHomeLocal}/webapps/${warname}.war").delete()
file("${tomcatHomeLocal}/webapps/${warname}").deleteDir()
println "Undeployed!"
}
}
task redeployView(type: Copy) {
description = "Redeploys view files (htmls)"
from "${webAppDirName}/"
into "${tomcatHomeLocal}/webapps/${shortName}/"
}
task redeployLocal(dependsOn: ["undeployLocal", "deployLocal"]) {
description = "Redeploys the module to local web-container"
doLast {
println "Redeploying application locally"
}
}
war {
rootSpec.exclude("**/workdir/")
}