-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
120 lines (95 loc) · 3.23 KB
/
build.gradle
File metadata and controls
120 lines (95 loc) · 3.23 KB
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
import org.apache.tools.ant.filters.ReplaceTokens
apply plugin: 'java'
apply plugin: "war"
configurations {
all*.exclude group: "commons-logging"
all*.exclude module: "slf4j-log4j12"
}
// 项目构建JDK版本
sourceCompatibility = 1.8
targetCompatibility = 1.8
// 编译参数
[compileJava, compileTestJava]*.options*.compilerArgs = ["-Xlint:none", "-g"]
[compileJava, javadoc, compileTestJava]*.options*.encoding = 'UTF-8'
// 仓库
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
// Spring
compile "org.springframework:spring-aop:$springVersion",
"org.springframework:spring-core:$springVersion",
"org.springframework:spring-beans:$springVersion",
"org.springframework:spring-context:$springVersion"
// Logging
compile "org.slf4j:slf4j-api:$slf4jVersion",
"org.slf4j:jcl-over-slf4j:$slf4jVersion"
compile "org.apache.logging.log4j:log4j-slf4j-impl:$log4jVersion"
runtime "org.apache.logging.log4j:log4j-core:$log4jVersion"
// mysql
compile "mysql:mysql-connector-java:$mysqlVersion"
// spring orm
compile "org.springframework:spring-jdbc:$springVersion"
// spring mvc
compile "org.springframework:spring-webmvc:$springVersion"
compile "org.springframework:spring-web:$springVersion"
// spring hateoas
compile "org.springframework.hateoas:spring-hateoas:$springHateoasVersion"
// spring data rest
compile 'org.springframework.data:spring-data-rest-webmvc:2.1.0.RELEASE'
// spring data
compile "org.springframework.data:spring-data-rest-webmvc:2.1.0.RELEASE",
"org.springframework.data:spring-data-jpa:$springDataJpaVersion",
"org.springframework.data:spring-data-commons:$springDataCommonsVersion"
// hibernate
compile "org.hibernate:hibernate-entitymanager:$hibernateVersion"
// redis
compile "org.springframework.data:spring-data-redis:$springDataRedisVersion"
// library
compile "joda-time:joda-time:$jodaVersion",
"com.fasterxml.jackson.core:jackson-databind:$jacksonVersion"
providedCompile "org.projectlombok:lombok:1.12.4"
//
providedCompile "javax.servlet:javax.servlet-api:3.0.1",
'javax.servlet.jsp:javax.servlet.jsp-api:2.3.1'
// Testing
testCompile "junit:junit:$junitVersion",
"org.hamcrest:hamcrest-library:$hamcrestVersion",
"org.springframework:spring-test:$springVersion",
"org.hsqldb:hsqldb:$hsqldbVersion",
"com.jayway.jsonpath:json-path:$jsonpathVersion"
}
// ==================================
task dev(dependsOn:["compileJava", "processResources"]) {
println 'package war in dev environment'
}
dev << {
copy {
from "$rootDir/src/config/dev"
into "$buildDir/resources/main/"
include "**/*"
}
println ':classes'
classes.execute();
println ':war'
war.execute();
}
// ==================================
task product(dependsOn:["compileJava", "processResources"]) {
println 'package war in product environment'
}
product << {
copy {
from "$rootDir/src/config/product"
into "$buildDir/resources/main/"
include "**/*"
}
println ':classes'
classes.execute();
println ':war'
war.execute();
}
task wrapper(type:Wrapper){
gradleVersion= '1.11'
}