1
+ // gradle build -Pprofile=real (or real, demo)
2
+ final String DEFAULT_PROFILE = ' local'
3
+
1
4
buildscript {
2
5
ext {
3
6
springBootVersion = ' 2.0.4.RELEASE'
@@ -17,9 +20,18 @@ apply plugin: 'org.springframework.boot'
17
20
apply plugin : ' io.spring.dependency-management'
18
21
apply plugin : ' war'
19
22
20
- group = ' gaia3d'
21
- version = ' 0.0.1-SNAPSHOT'
22
- sourceCompatibility = 1.8
23
+ war {
24
+ baseName = ' livedronemap-user'
25
+ version = ' 0.0.1-SNAPSHOT'
26
+ }
27
+
28
+ compileJava {
29
+ sourceCompatibility = 1.8
30
+ targetCompatibility = 1.8
31
+ // gralde 5.0 lombok error
32
+ // options.compilerArgs += ["-proc:none"]
33
+ }
34
+ compileJava. options. encoding = ' UTF-8'
23
35
24
36
repositories {
25
37
mavenCentral()
@@ -29,12 +41,38 @@ configurations {
29
41
providedRuntime
30
42
}
31
43
44
+ sourceSets {
45
+ main {
46
+ resources {
47
+ if (! project. hasProperty(' profile' ) || ! profile) {
48
+ println " ========== > default profile is local. "
49
+ ext. profile = DEFAULT_PROFILE
50
+ }
51
+
52
+ if (profile == ' real' ) {
53
+ println " ===========> profile file is ${ profile} "
54
+ srcDir " src/main/resources/${ profile} "
55
+ // copy {
56
+ // from "src/main/resources/${profile}"
57
+ // into "src/main/resources"
58
+ // }
59
+ } else {
60
+ println " ===========> profile file is ${ profile} "
61
+ // srcDir "src/main/resources"
62
+ exclude " **/real/*"
63
+ }
64
+ }
65
+ }
66
+ }
67
+
32
68
dependencies {
33
69
compile(' org.springframework.boot:spring-boot-starter-web' )
34
70
compile(' org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.2' )
35
71
compile(' org.springframework.boot:spring-boot-starter-thymeleaf' )
36
72
compile(' javax.servlet:jstl' )
37
73
compile (' org.apache.commons:commons-io:1.3.2' )
74
+ compile ' com.zaxxer:HikariCP:3.2.0'
75
+ compile ' org.apache.taglibs:taglibs-standard-jstlel:1.2.5'
38
76
39
77
runtime(' org.springframework.boot:spring-boot-devtools' )
40
78
runtime(' org.postgresql:postgresql' )
@@ -44,7 +82,8 @@ dependencies {
44
82
compileOnly(" org.projectlombok:lombok:$lombokVersion " )
45
83
testAnnotationProcessor(" org.projectlombok:lombok:$lombokVersion " )
46
84
testCompileOnly(" org.projectlombok:lombok:$lombokVersion " )
47
-
85
+ // compileOnly("org.projectlombok:lombok:$lombokVersion")
86
+
48
87
testCompile(' org.springframework.boot:spring-boot-starter-test' )
49
88
50
89
providedRuntime(' org.springframework.boot:spring-boot-starter-tomcat' )
0 commit comments