-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
70 lines (66 loc) · 1.88 KB
/
build.gradle
File metadata and controls
70 lines (66 loc) · 1.88 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
64
65
66
67
68
69
70
buildscript {
// repositories for build script dependencies
repositories {
mavenLocal()
maven {
name "alimaven"
url "https://maven.aliyun.com/nexus/content/groups/public/"
}
// maven {
// url "https://plugins.gradle.org/m2/"
// }
// mavenCentral()
}
dependencies {
classpath "org.ajoberstar.grgit:grgit-gradle:4.1.0"
classpath "io.spring.gradle:dependency-management-plugin:1.0.11.RELEASE"
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.5.4"
}
}
// git version
apply plugin: "org.ajoberstar.grgit"
int commits = grgit.log().size()
version = "${projectVersion}.${commits}"
if (!project.hasProperty("release")) {
String branch = grgit.branch.current().name
String prefix = branch.replace("/", "-")
String abbreviatedId = grgit.head().abbreviatedId
version = "${prefix}-${version}.${abbreviatedId}"
}
println("gitVersion=$version")
subprojects {
// repositories for project dependencies
repositories {
if (!project.hasProperty("release")) {
mavenLocal()
}
maven {
name "alimaven"
url "https://maven.aliyun.com/nexus/content/groups/public/"
}
// mavenCentral()
}
group("$projectGroup")
version = rootProject.version
apply plugin: 'java'
java {
withJavadocJar()
withSourcesJar()
}
jar.doLast {
println "jar: ${archiveFile.get()}"
}
test.doLast {
println test.reports.html.entryPoint
}
configurations.all {
// check for updates every build
resolutionStrategy {
cacheChangingModulesFor 0, 'seconds'
cacheDynamicVersionsFor 0, 'seconds'
}
}
configurations {
all*.exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
}
}