This repository has been archived by the owner on Mar 5, 2018. It is now read-only.
forked from danielliao11/spring-microservice-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
executable file
·141 lines (119 loc) · 3.85 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
description 'spring-micro-services-boilerplate'
group 'com.saintdan.framework'
version '0.18.2.RELEASE'
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'maven' // If you want use maven.
//apply plugin: 'war' // If you want use provide runtime dependencies.
buildscript {
repositories {
// If you live in China. You can use ali's repository.
maven {
url 'http://maven.aliyun.com/nexus/content/groups/public/'
}
maven {
url 'https://repo.spring.io/plugins-release'
}
mavenCentral()
jcenter()
}
dependencies {
classpath('org.springframework.boot:spring-boot-gradle-plugin:1.5.3.RELEASE')
}
}
allprojects {
repositories {
// If you live in China. You can use ali's repository.
maven {
url 'http://maven.aliyun.com/nexus/content/groups/public/'
}
maven {
url 'https://repo.spring.io/plugins-release'
}
mavenCentral()
jcenter()
}
}
compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
compileTestJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
ext {
springBootVersion = '1.5.3.RELEASE'
springOAuth2Version = '2.1.0.RELEASE'
springBootAdminVersion = '1.5.0'
jacksonVersion = '2.8.5'
commonsLang3Version = '3.5'
guavaVersion = '21.0'
swaggerVersion = '2.6.1'
specVersion = '0.9.0'
// hsqldbVersion = '1.8.0.10'
// mysqlVersion = '5.1.36'
postgresqlVersion = '42.0.0'
jsonPathVersion = '2.0.0'
junitVersion = '4.12'
}
dependencies {
// Spring boot dependencies.
compile "org.springframework.boot:spring-boot-starter-web:${springBootVersion}"
compile "org.springframework.boot:spring-boot-starter-actuator:${springBootVersion}"
compile "org.springframework.boot:spring-boot-starter-security:${springBootVersion}"
compile "org.springframework.boot:spring-boot-starter-data-jpa:${springBootVersion}"
compile "org.springframework.boot:spring-boot-devtools"
// Spring oauth2 dependency.
compile "org.springframework.security.oauth:spring-security-oauth2:${springOAuth2Version}"
// Spring Boot Admin
compile "de.codecentric:spring-boot-admin-server:${springBootAdminVersion}"
// Other dependencies.
compile "org.apache.commons:commons-lang3:${commonsLang3Version}"
compile "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}"
compile "com.google.guava:guava:${guavaVersion}"
compile ("net.kaczmarzyk:specification-arg-resolver:${specVersion}") {
exclude group:'org.hibernate.javax.persistence'
}
//swagger
compile "io.springfox:springfox-swagger2:${swaggerVersion}"
compile "io.springfox:springfox-swagger-ui:${swaggerVersion}"
// DB dependencies.
// You can choose one of them.
// HSQLDB
// compile "org.hsqldb:hsqldb:${hsqldbVersion}"
// Mysql
// compile "mysql:mysql-connector-java:${mysqlVersion}"
// Postgres
compile "org.postgresql:postgresql:${postgresqlVersion}"
// Provide runtime dependencies.
// Tomcat
// providedRuntime "org.springframework.boot:spring-boot-starter-tomcat:${springBootVersion}"
// Undertow - Undertow is a lightweight servlet container from JBoss
// providedRuntime "org.springframework.boot:spring-boot-starter-undertow:${springBootVersion}"
// Test dependencies.
testCompile "org.springframework.boot:spring-boot-starter-test:${springBootVersion}"
testCompile "com.jayway.jsonpath:json-path:${jsonPathVersion}"
testCompile "com.jayway.jsonpath:json-path-assert:${jsonPathVersion}"
testCompile "junit:junit:${junitVersion}"
}
task wrapper(type: Wrapper) {
gradleVersion = '3.5'
}
task writeNewPom {
doLast {
pom {
project {
inceptionYear '2017'
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
}
}.writeTo("pom.xml")
}
}