-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
70 lines (61 loc) · 1.81 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
group = 'com.natsumes'
version = '1.0-SNAPSHOT'
buildscript {
ext {
//定义一个变量,统一规定springboot的版本
springBootVersion = '2.1.7.RELEASE'
}
repositories {
maven {
url = 'http://maven.aliyun.com/nexus/content/groups/public/'
}
jcenter()
mavenCentral()
}
dependencies { //用来打包
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
allprojects {
repositories {
maven {
url = 'http://maven.aliyun.com/nexus/content/groups/public/'
}
jcenter()
mavenCentral()
}
//指定编码格式
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
}
//设定当前模块项目中的配置
subprojects {
apply plugin: 'java'
apply plugin: 'idea'
//spring boot 插件
apply plugin: 'org.springframework.boot'
//A Gradle plugin that provides Maven-like dependency management functionality
apply plugin: 'io.spring.dependency-management'
group 'com.natsumes'
version '1.0.0'
dependencies {
implementation('org.springframework.boot:spring-boot-starter-web')
implementation('com.alibaba:fastjson:1.2.69')
compileOnly('org.projectlombok:lombok')
annotationProcessor('org.projectlombok:lombok')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
dependencyManagement {
imports {
//spring bom helps us to declare dependencies without specifying version numbers.
mavenBom "org.springframework.boot:spring-boot-starter-parent:${springBootVersion}"
}
}
jar {
enabled = true
manifest.attributes provider: 'gradle'
}
sourceCompatibility = 11
targetCompatibility = 11
}