forked from candrews/log4jdbc-spring-boot-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
159 lines (138 loc) · 4 KB
/
build.gradle.kts
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
`java-library`
alias(libs.plugins.spring.deps.management)
alias(libs.plugins.kt3k.coveralls)
jacoco
pmd
`maven-publish`
signing
alias(libs.plugins.axion.release)
alias(libs.plugins.nexus.publish)
}
group = "ru.vasiand"
version = scmVersion.version
repositories {
mavenCentral()
}
dependencyManagement {
imports {
mavenBom(libs.spring.boot.deps.get().toString())
}
}
dependencies {
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
annotationProcessor(libs.lombok)
compileOnly(libs.lombok)
implementation(libs.log4jdbc)
implementation("jakarta.annotation:jakarta.annotation-api")
implementation("org.springframework.boot:spring-boot-autoconfigure")
testImplementation("com.h2database:h2")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.springframework.boot:spring-boot-starter-data-jpa")
testCompileOnly(libs.lombok)
testAnnotationProcessor(libs.lombok)
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
withSourcesJar()
withJavadocJar()
}
tasks.compileJava {
options.compilerArgs.addAll(
listOf(
"-Xlint:all,-processing",
"-Xdoclint:none",
"-Werror",
)
)
options.encoding = "UTF-8"
}
tasks.test {
useJUnitPlatform()
testLogging {
events = setOf(TestLogEvent.FAILED)
exceptionFormat = TestExceptionFormat.FULL
}
}
tasks.jacocoTestReport {
dependsOn(tasks.test) // tests are required to run before generating the report
reports {
xml.required = true
html.required = true
}
classDirectories.setFrom(
files(classDirectories.files.map {
fileTree(it) {
exclude("**/Log4jdbcProperties*")
}
})
)
}
pmd {
toolVersion = "6.23.0"
ruleSetFiles = files("pmd.xml")
}
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}
tasks.jar {
manifest {
attributes(
mapOf(
"Implementation-Title" to project.name,
"Implementation-Version" to project.version
)
)
}
from(rootProject.projectDir) {
include("LICENSE.txt")
into("META-INF")
}
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
pom {
name.set(project.name)
description.set("The Log4jdbc Spring Boot 3 Starter facilitates the quick and easy use of http://log4jdbc.brunorozendo.com/ in Spring Boot projects.")
url.set("https://github.com./andrey-vasilyev/spring-boot-starter-log4jdbc")
licenses {
license {
name.set("The Apache Software License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("andrey-vasilyev")
name.set("Andrey Vasilyev")
email.set("[email protected]")
}
}
scm {
url.set("https://github.com./andrey-vasilyev/spring-boot-starter-log4jdbc")
}
}
}
}
}
val gpgKey: String? = System.getenv("GPG_KEY")
val gpgPass: String? = System.getenv("GPG_PASS")
signing {
isRequired = gpgKey != null
useInMemoryPgpKeys(gpgKey, gpgPass)
sign(publishing.publications["mavenJava"])
}
tasks.verifyRelease {
dependsOn(tasks.check)
}