-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
188 lines (152 loc) · 5.38 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
177
178
179
180
181
182
183
184
185
186
187
buildscript {
repositories {
maven {
url 'http://maven.aliyun.com/nexus/content/groups/public/'
}
maven {
url 'https://maven.aliyun.com/repository/public/'
}
maven {
url "https://plugins.gradle.org/m2/"
}
maven {
url 'http://www.datanucleus.org/downloads/maven2/'
}
maven {
url 'http://nexus.pentaho.org/content/groups/omni'
}
mavenCentral()
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
classpath "io.spring.gradle:dependency-management-plugin:${springDependencyManagementVersion}"
}
}
allprojects {
ext {
/**
* gradle jvm 参数:
* -Dlevel=snapshot or -Dlevel=release
*/
buildLevel = System.getProperty("level") ?: "snapshot"
}
apply plugin: 'io.spring.dependency-management'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'idea'
apply plugin: 'eclipse'
group = 'com.muyi.courage'
version = "$version"
sourceCompatibility = '1.8'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
if ("release".equals(buildLevel)) {
version += "-RELEASE"
} else {
version += "-SNAPSHOT"
}
repositories {
maven {
url 'http://maven.aliyun.com/nexus/content/groups/public/'
}
maven {
url 'https://maven.aliyun.com/repository/public/'
}
maven {
url "https://plugins.gradle.org/m2/"
}
maven {
url 'http://www.datanucleus.org/downloads/maven2/'
}
maven {
url 'http://nexus.pentaho.org/content/groups/omni'
}
mavenCentral()
}
dependencyManagement {
imports {
mavenBom "org.springframework.boot:spring-boot-starter-parent:${springBootVersion}"
mavenBom 'org.springframework.cloud:spring-cloud-dependencies:Hoxton.SR7'
}
}
dependencies {
// test
testImplementation "junit:junit:${junitVersion}"
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
// spring
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-aop'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
runtimeOnly 'org.springframework.boot:spring-boot-devtools'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-data-mongodb'
// mybatis
implementation "org.mybatis.spring.boot:mybatis-spring-boot-starter:${springBootMybatisVersion}"
compile "com.github.xiaoymin:knife4j-spring-boot-starter:${knife4jVersion}"
}
}
subprojects {
if (it.name.endsWith("common")) {
dependencies {
compile 'io.github.openfeign:feign-httpclient'
compile 'com.netflix.ribbon:ribbon'
}
}
if (it.name.endsWith("-api")) {
dependencies {
compile project(":common")
}
}
// 子模块的通用依赖
dependencies {
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.8.1'
// jdbc
compile "org.springframework.boot:spring-boot-starter-jdbc"
// 数据库驱动
compile 'mysql:mysql-connector-java:5.1.49'
// redis
implementation 'com.alibaba:fastjson:1.2.72'
compile "org.springframework.boot:spring-boot-starter-data-redis"
compile "org.apache.commons:commons-pool2"
// mapstruct
compileOnly "org.mapstruct:mapstruct-processor:${mapstructVersion}"
annotationProcessor "org.mapstruct:mapstruct-processor:${mapstructVersion}"
implementation "org.mapstruct:mapstruct-jdk8:${mapstructVersion}"
// lombok
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
compile "org.springframework.cloud:spring-cloud-starter-openfeign:2.2.4.RELEASE"
}
}
// 根项目
dependencies {
compile project(":quartz:quartz-sdk")
compile project(":quartz:quartz-impl")
compile project(":rabbitMq:rabbitMq-api")
compile project(":rabbitMq:rabbitMq-impl")
compile project(":rabbitMq:rabbitMq-sdk")
compile project(":handler:handler-sdk")
compile project(":auth:auth-api")
compile project(":auth:auth-impl")
compile project(":aop:aop-impl")
compile project(":mongoDB:mongoDB-api")
compile project(":mongoDB:mongoDB-impl")
compile project(":algorithm:algorithm-sdk")
compileOnly "io.springfox:springfox-swagger2:${springfoxSwaggerVersion}"
compileOnly "io.springfox:springfox-swagger-ui:${springfoxSwaggerVersion}"
}
// 启动打包到 build/publish/
apply plugin: 'org.springframework.boot'
bootJar {
doLast {
copy {
from("$rootDir/bins/")
into("$buildDir/publish")
}
}
}