-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
63 lines (50 loc) · 1.57 KB
/
build.gradle
File metadata and controls
63 lines (50 loc) · 1.57 KB
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
/**
* Spring Boot 2.0.x Project Build
*/
// Apply the build scan and Spring Boot 2.0.x plugin
// tag::plugins[]
plugins {
id 'java'
id 'com.gradle.build-scan' version '3.0'
id 'org.springframework.boot' version '2.2.0.RELEASE'
id 'io.spring.dependency-management' version '1.0.8.RELEASE'
}
// end::plugins[]
// Add the repository for dependency resolution
repositories {
jcenter()
}
// Add Spring Boot BOM and dependencies for the Spring Boot Starter Web/Test
// tag::dependencies[]
dependencies {
implementation 'org.springframework.boot:spring-boot-dependencies:2.2.0.RELEASE'
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
components {
withModule('org.springframework:spring-beans') {
allVariants {
withDependencyConstraints {
// Need to patch constraints because snakeyaml is an optional dependency
it.findAll { it.name == 'snakeyaml' }.each { it.version { strictly '1.19' } }
}
}
}
}
}
// end::dependencies[]
// Define the main class used for the executable artifacts
// tag::mainClassName[]
bootJar {
mainClassName = 'hello.App'
}
// end::mainClassName[]
// Configure the Gradle's Build Scan plugin
// tag::buildScan[]
buildScan {
// always accept the terms of service
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
// always publish a build scan
publishAlways()
}
// end::buildScan[]