-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
69 lines (58 loc) · 2.15 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
plugins {
id "application"
id 'java'
id "io.spring.dependency-management" version "1.0.10.RELEASE"
}
repositories {
mavenCentral()
}
apply plugin : "java"
ext {
javaMainClass = "ru.otus.algorithms.homework07.Main"
}
application {
mainClassName = javaMainClass
}
allprojects {
group "ru.otus.algorithms"
//sourceCompatibility = JavaVersion.VERSION_1_8
//targetCompatibility = JavaVersion.VERSION_1_8
repositories {
mavenCentral()
}
apply plugin: "io.spring.dependency-management"
dependencyManagement {
dependencies {
imports {
/*-
To solve version mismatch issue, you can use the concept of a “bill of materials” (BOM) dependency.
A BOM dependency keep track of version numbers and ensure that all
dependencies (both direct and transitive) are at the same version.
Use "BOM" file from Spring
Spring BOM: https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-dependencies/3.0.5/spring-boot-dependencies-3.0.5.pom
*/
mavenBom("org.springframework.boot:spring-boot-dependencies:3.0.5")
}
// If lib is not exist in BOM file than add it manually (e.g. "com.google.guava")
//dependency("com.google.guava:guava:${guavaVersion}")
}
}
}
dependencies {
/*-
Если явно не прописано, то версия возьмется из BOM-файла (can see by custom task "managedVersions" in parent).
Если проект не многомодульный и не содержит стороннего BOM то нужно самому прописывать версии.
Или если библиотеки нет в BOM файле.
If lib is not exist in BOM file than add it manually (e.g. "com.google.guava")
*/
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
//testImplementation 'junit:junit:4.12'
}
//print versions from BOM
task managedVersions {
doLast {
dependencyManagement.managedVersions.each {
println it
}
}
}