-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle
107 lines (83 loc) · 3.14 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 {
maven {
url 'http://maven.aliyun.com/nexus/content/groups/public/'
}
maven {
url "https://plugins.gradle.org/m2/"
}
mavenCentral()
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
classpath "io.spring.gradle:dependency-management-plugin:${springDependencyManagementVersion}"
classpath "net.ltgt.gradle:gradle-apt-plugin:0.19"
}
}
allprojects {
repositories {
maven {
url 'http://maven.aliyun.com/nexus/content/groups/public/'
}
mavenCentral()
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'io.spring.dependency-management'
if (project.hasProperty("prod")) {
apply from: "$rootDir/gradle/profile_prod.gradle"
} else {
apply from: "$rootDir/gradle/profile_dev.gradle"
}
sourceCompatibility = 1.8
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:Edgware.SR5"
mavenBom "org.springframework.boot:spring-boot-starter-parent:${springBootVersion}"
}
dependencies {
dependency "de.codecentric:spring-boot-admin-server:${springBootAdminVersion}"
dependency "de.codecentric:spring-boot-admin-server-ui:${springBootAdminVersion}"
dependency "de.codecentric:spring-boot-admin-server-ui-hystrix:${springBootAdminVersion}"
dependency "net.logstash.logback:logstash-logback-encoder:${logstashLogbackVersion}"
}
}
jar {
version = "$version"
}
if (it.name.endsWith("-api")) {
dependencies {
compile "org.springframework.boot:spring-boot-starter-web"
}
}
if (it.name.endsWith("-impl") || it.name == "api-gateway" || it.name == "config-server" || it.name == "eureka-server") {
apply plugin: 'org.springframework.boot'
dependencies {
testCompile "junit:junit:${junitVersion}"
testCompile 'org.springframework.boot:spring-boot-starter-test'
}
}
if (it.name.endsWith("-impl") || it.name.endsWith("-api")) {
apply plugin: "net.ltgt.apt"
apply from: "$rootDir/gradle/lombok.gradle"
}
if (it.name.endsWith("-impl")) {
apply from: "$rootDir/gradle/mapstruct.gradle"
dependencies {
compile 'org.springframework.cloud:spring-cloud-starter-config'
compile 'org.springframework.cloud:spring-cloud-starter-eureka'
compile 'org.springframework.cloud:spring-cloud-starter-hystrix'
compile 'org.springframework.boot:spring-boot-starter-actuator'
compile "org.mybatis.spring.boot:mybatis-spring-boot-starter:${springBootMybatisVersion}"
compile 'com.zaxxer:HikariCP'
compile "mysql:mysql-connector-java:${mysqlVersion}"
}
}
if (it.name.endsWith("-client")) {
dependencies {
compile 'org.springframework.cloud:spring-cloud-starter-feign'
}
}
}