-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathbuild.gradle
84 lines (74 loc) · 3.1 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
plugins {
id 'java'
id 'idea'
}
/**
* 使用Groovy语言语法定义版本号变量
*/
def spring_boot_version = "2.1.5.RELEASE"
def mybatis_plus_version = "3.1.2"
def mysql_version = "8.0.21"
def druid_version = "1.1.23"
def logback_version = "1.2.1"
def fastjson_version = "1.2.73"
def lombok_version = "1.18.12"
def lang_version = "3.4"
def io_version = "2.6"
def guava_version = "18.0"
def hutool_version = "5.3.10"
def swagger2_version = "2.9.2"
def swagger_bsi_version = "1.9.2"
group = 'com.flong'
version = '0.0.1-SNAPSHOT'
//jdk版本
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
repositories {
//指定阿里云镜像
maven {
url 'http://maven.aliyun.com/nexus/content/groups/public/'
}
mavenLocal()
mavenCentral()
}
/**
* 1、implementation 履行 、compile 编译
* 2、Gradle使用双引号可 ${变量}可以放入引号里面,单引号是不可以的。
* 3、Gragle使用lombok需要引入annotationProcessor注解,否则不能使用lombok.
* 4、mybatis-plus3.2.x以上版本引用了Kotlin的支持
* 5、高版本Springboogt在spring-boot-dependencies-2.3.0.RELEASE.pom里面引入了mysql8.0.2的`<mysql.version>8.0.20</mysql.version>`配置
*/
dependencies {
implementation "org.springframework.boot:spring-boot-starter:${spring_boot_version}"
//排除tomcat使用undertow
compile("org.springframework.boot:spring-boot-starter-web:${spring_boot_version}") {
exclude module: "spring-boot-starter-tomcat"
}
compile "org.springframework.boot:spring-boot-starter-undertow:${spring_boot_version}"
//runtime group: 'mysql', name: 'mysql-connector-java', version: '5.1.42'
compile "org.springframework.boot:spring-boot-devtools:${spring_boot_version}"
compile "org.springframework.boot:spring-boot-configuration-processor:${spring_boot_version}"
compile "org.springframework.boot:spring-boot-starter-test:${spring_boot_version}"
compile "com.baomidou:mybatis-plus-extension:${mybatis_plus_version}"
compile "com.baomidou:mybatis-plus-boot-starter:${mybatis_plus_version}"
compile "mysql:mysql-connector-java:${mysql_version}"
compile "com.alibaba:druid:${druid_version}"
compile "ch.qos.logback:logback-classic:${logback_version}"
compile "com.alibaba:fastjson:${fastjson_version}"
annotationProcessor "org.projectlombok:lombok:${lombok_version}"
compileOnly "org.projectlombok:lombok:${lombok_version}"
//testAnnotationProcessor "org.projectlombok:lombok:${lombok_version}"
//testCompileOnly "org.projectlombok:lombok:${lombok_version}"
compile "org.apache.commons:commons-lang3:${lang_version}"
compile "commons-io:commons-io:${io_version}"
compile "com.google.guava:guava:${guava_version}"
compile "cn.hutool:hutool-all:${hutool_version}"
compile "io.springfox:springfox-swagger2:${swagger2_version}"
compile "com.github.xiaoymin:swagger-bootstrap-ui:${swagger_bsi_version}"
}
//设置编码模式
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
//设置编码模式
[compileJava, javadoc, compileTestJava]*.options*.encoding = "UTF-8"