-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
176 lines (141 loc) · 5.51 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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
/**
* This is the Gradle build script.
*/
description = "This is the CSA Prioritization Tool build file. It uses spring boot."
buildscript {
repositories {
mavenCentral()
maven { url "http://repo.spring.io/plugins-release" }
}
dependencies {
// Spring boot integration with gradle
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.2.3.RELEASE")
// Plugin to reload changed classes with out restarting
classpath("org.springframework:springloaded:1.2.3.RELEASE")
// Plugin to include optional dependencies
classpath("org.springframework.build.gradle:propdeps-plugin:0.0.7")
// Plugin to deploy the war file to a remote Tomcat
classpath("com.bmuschko:gradle-cargo-plugin:2.1.1")
}
}
// Includes java plugin
apply plugin: "war"
apply plugin: "spring-boot"
apply plugin: "propdeps"
apply plugin: "com.bmuschko.cargo"
// This customization is directly guided to Openshift deployment
war {
archiveName = "ROOT.war"
destinationDir = file("webapps")
}
// Hopefully speeds up the process of searching for a proper main class
mainClassName = "org.cgiar.ccafs.csa.CSAToolApplication"
// Pre-process resources before the code is compiled
compileJava.dependsOn(processResources)
bootRun {
// Support passing -Dsystem.property=value to bootRun task
systemProperties = System.properties
}
// Location of the libraries for the application. They are tried from top to bottom.
repositories {
//mavenLocal()
mavenCentral()
maven { url "http://repository.primefaces.org" }
}
/*
* These dependencies actually determinate the behavior of the application. Spring boot
* Searches the jars and configures the app in a way that works with the libraries.
* This particular app, has support for Spring Mvc, JPA and Security. LightAdmin,
* Prime Faces, Postgresql, MySql and H2 databases, and an embedded Tomcat.
*/
dependencies {
def springBootVersion = "1.2.4.RELEASE"
def springVersion = "4.1.6.RELEASE"
compile "org.springframework.boot:spring-boot-starter:$springBootVersion"
compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion"
optional "org.springframework.boot:spring-boot-configuration-processor:$springBootVersion"
compile "org.springframework:spring-webmvc:$springVersion"
compile "org.springframework:spring-aspects:$springVersion"
compile "org.springframework:spring-orm:$springVersion"
// Includes tomcat-embed-core, tomcat-embed-el, ecj
providedCompile "org.apache.tomcat.embed:tomcat-embed-jasper:8.0.23"
providedCompile "org.apache.tomcat.embed:tomcat-embed-logging-juli:8.0.23"
compile("org.springframework.data:spring-data-jpa:1.7.2.RELEASE") {
// Requests an older version with different name
exclude module: "aspectjrt"
}
compile "org.hibernate:hibernate-entitymanager:4.3.10.Final"
compile "org.hibernate:hibernate-validator:5.1.3.Final"
// Needs to be included in the final war, otherwise Tomcat will fail
compile "org.javassist:javassist:3.18.2-GA"
// For excel parsing
compile "org.apache.poi:poi-ooxml:3.11"
// Springloaded doesn"t like Java 8 version.
compile("com.zaxxer:HikariCP-java6:2.3.7") {
// The javassist version it depends on is not compatible with other libraries of the project
exclude module: "javassist"
}
// Database drivers are part of the container
providedRuntime "org.postgresql:postgresql:9.2-1004-jdbc4"
//providedRuntime "mysql:mysql-connector-java:5.1.34"
// MUST remain 1.4.186
providedCompile "com.h2database:h2:1.4.186"
// Database migrations
compile "org.flywaydb:flyway-core:3.2.1"
compile "com.fasterxml.jackson.core:jackson-databind:2.5.1"
// For backend administration. Excludes some apache tiles extras
compile ("org.lightadmin:lightadmin:1.2.0.RC1") {
exclude module: "tiles-freemarker"
exclude module: "tiles-request-mustache"
exclude module: "tiles-velocity"
exclude module: "tiles-mvel"
exclude module: "tiles-ognl"
}
// Includes JSF libraries
compile "org.apache.myfaces.core:myfaces-api:2.2.8"
compile "org.apache.myfaces.core:myfaces-impl:2.2.8"
// Pretty faces for URL rewriting
compile "com.ocpsoft:prettyfaces-jsf2:3.3.3"
// Prime Faces for UI components
compile "org.primefaces:primefaces:5.2"
compile "org.primefaces.themes:smoothness:1.0.10"
// Angular Faces For Angular integration
//compile "de.beyondjava:angularFaces-core:2.1.4"
// Boots Faces for Bootstrap Layouts
compile "net.bootsfaces:bootsfaces:0.6.6"
// For testing
testCompile "org.springframework:spring-test:$springVersion"
testCompile "junit:junit:4.12"
testCompile "org.mockito:mockito-core:1.10.8"
testCompile "org.hamcrest:hamcrest-library:1.3"
}
/*
* Gradle Wrapper task, it downloads Gradle and creates the proper environment for developers
* who get the source code from github.
*/
task wrapper(type: Wrapper) {
gradleVersion = "2.4"
}
/*
* Deploys the war file to the webapps folder in Tomcat
*/
task deploy(type: Copy, dependsOn: "war") {
from "webapps/ROOT.war"
into System.getenv("CATALINA_HOME") + "/webapps/"
}
/*
* This configuration allows the Cargo plugin to deploy the war file to the production server.
*
*/
cargo {
containerId = "tomcat8x"
port = 80
deployable {
context = "/"
}
remote {
hostname = "csatool.cgiarad.org"
username = "admin"
password = "admin"
}
}