-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
106 lines (85 loc) · 2.78 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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.3.0.RELEASE")
}
}
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'spring-boot'
jar {
baseName = 'gspringmvc'
version = '0.1.0'
}
repositories {
mavenCentral()
maven { url "https://repository.jboss.org/nexus/content/repositories/releases" }
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
configurations.all {
// Logback slf4j conflict
exclude group: "commons-logging", module: "commons-logging"
}
dependencies {
// Groovy
compile( "org.codehaus.groovy:groovy-all" )
// Spring boot logging
compile ( "org.springframework.boot:spring-boot-starter-logging" )
// Spring boot
compile( "org.springframework.boot:spring-boot-starter-web" )
compile( "org.springframework.boot:spring-boot-starter-actuator" )
// Spring view renderer
compile( "org.springframework.boot:spring-boot-starter-thymeleaf" )
// JPA
compile( "org.springframework.boot:spring-boot-starter-data-jpa" )
compile( "org.springframework:spring-tx" )
compile( "com.h2database:h2" ) // dev
compile( "org.apache.commons:commons-dbcp2" )
runtime( "org.postgresql:postgresql") // test
// Spring boot security
compile( "org.springframework.boot:spring-boot-starter-security" )
// AspectJ
compile( "org.aspectj:aspectjrt" )
compile( "org.aspectj:aspectjtools" )
compile( "org.aspectj:aspectjweaver" )
// JTS - If/when were ready
//compile("com.vividsolutions:jts")
// Tests
testCompile("org.springframework.boot:spring-boot-starter-test")
}
task wrapper(type: Wrapper) {
gradleVersion = '2.7'
}
test {
if ( project.hasProperty('jvmArgs') ) {
def argsList = (project.jvmArgs.split("\\s+") as List<String>)
boolean profileSet = false
argsList.each { arg ->
println arg.indexOf("-Dspring.profiles.active=")
if (arg.indexOf("-Dspring.profiles.active=")>=0) { profileSet = true }
}
if (!profileSet) { argsList.add("-Dspring.profiles.active=dev") }
jvmArgs = argsList
} else {
jvmArgs = ["-Dspring.profiles.active=dev"]
}
}
bootRun {
if ( project.hasProperty('jvmArgs') ) {
def argsList = (project.jvmArgs.split("\\s+") as List<String>)
boolean profileSet = false
argsList.each { arg ->
println arg.indexOf("-Dspring.profiles.active=")
if (arg.indexOf("-Dspring.profiles.active=")>=0) { profileSet = true }
}
if (!profileSet) { argsList.add("-Dspring.profiles.active=dev") }
jvmArgs = argsList
} else {
jvmArgs = [ "-Dspring.profiles.active=test" ]
}
}