-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathbuild.gradle
118 lines (108 loc) · 3.52 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
buildscript {
ext {
springBootVersion = '2.7.3'
}
}
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
id 'jacoco'
}
java {
withJavadocJar()
withSourcesJar()
}
group = 'top.code2life'
version = '1.0.9'
sourceCompatibility = JavaVersion.VERSION_1_8
repositories {
mavenCentral()
}
dependencies {
compileOnly 'org.projectlombok:lombok:1.18.20'
annotationProcessor 'org.projectlombok:lombok:1.18.20'
compileOnly "org.springframework.boot:spring-boot-starter:${springBootVersion}"
testCompileOnly 'org.projectlombok:lombok:1.18.20'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.20'
testImplementation('org.junit.jupiter:junit-jupiter:5.7.1')
testImplementation 'org.yaml:snakeyaml:1.28'
testImplementation "org.springframework.boot:spring-boot-starter-test:${springBootVersion}"
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'spring-boot-dynamic-config'
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = 'spring-boot-dynamic-config'
description = 'Enhance SpringBoot application with dynamic configuration ability'
url = 'https://github.com/code2life/spring-boot-dynamic-config'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'code2life'
name = 'Joey Yang'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:https://github.com/code2life/spring-boot-dynamic-config.git'
developerConnection = 'scm:git:https://github.com/code2life/spring-boot-dynamic-config.git'
url = 'https://github.com/code2life/spring-boot-dynamic-config'
}
}
}
}
repositories {
maven {
// change URLs to point to your repos, e.g. http://my.org/repo
def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2"
def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = System.getenv('OSSRHUSERNAME') ?: "${ossrhUsername}"
password = System.getenv('OSSRHPASSWORD') ?: "${ossrhPassword}"
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
javadoc {
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
test {
useJUnitPlatform()
ignoreFailures = false
finalizedBy jacocoTestReport
testLogging {
exceptionFormat = 'full'
}
}
jacocoTestReport {
dependsOn test
reports {
xml.enabled true
xml.destination file("${buildDir}/reports/jacoco/report.xml")
csv.enabled true
html.enabled true
html.destination layout.buildDirectory.dir('jacocoHtml').get().asFile
}
}