-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
148 lines (120 loc) · 4.03 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
import org.gradle.api.tasks.testing.logging.TestExceptionFormat.*
import org.gradle.api.tasks.testing.logging.TestLogEvent.*
tasks.withType<Test> {
useJUnitPlatform()
testLogging {
events(PASSED, SKIPPED, FAILED, STANDARD_ERROR)
exceptionFormat = FULL
showExceptions = true
showCauses = true
showStackTraces = true
showStandardStreams = true
}
}
plugins {
id("org.springframework.boot") version "2.6.6"
id("io.spring.dependency-management") version "1.0.11.RELEASE"
kotlin("jvm") version "1.6.0"
kotlin("plugin.spring") version "1.6.0"
id("maven-publish")
id("java-library")
id("net.researchgate.release") version "2.8.1"
id("com.adarshr.test-logger") version "2.1.1"
id("signing")
id("java")
}
group = "com.simplybusiness"
version = "1.0.11-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_1_8
repositories {
mavenCentral()
}
dependencies {
testCompileOnly("org.junit.jupiter", "junit-jupiter-api", "5.6.2")
testImplementation("org.junit.jupiter","junit-jupiter-engine","5.6.2")
testCompileOnly("org.junit.jupiter", "junit-jupiter-params", "5.6.2")
implementation("org.apache.kafka:kafka-clients:2.4.0")
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.13.2")
implementation("com.fasterxml.jackson.core:jackson-databind:2.13.2.2")
implementation("com.fasterxml.jackson.core:jackson-core:2.13.2")
implementation("com.fasterxml.jackson.core:jackson-annotations:2.13.2")
implementation("org.apache.logging.log4j:log4j-core:2.17.1")
implementation("org.apache.logging.log4j:log4j-api:2.17.1")
implementation("org.apache.logging.log4j:log4j-slf4j-impl:2.17.1")
implementation("commons-io:commons-io:2.11.0")
testImplementation("com.salesforce.kafka.test:kafka-junit5:3.2.2")
testImplementation("org.apache.kafka:kafka_2.12:2.4.0")
// implementation("net.researchgate:gradle-release:2.6.0")
}
val jar: Jar by tasks
jar.enabled = true
java {
withSourcesJar()
withJavadocJar()
}
val afterReleaseBuild by tasks.existing
val beforeReleaseBuild by tasks.existing
tasks.withType<JavaCompile> {
afterReleaseBuild {
dependsOn("publish")
}
}
signing {
sign(configurations.archives.get())
}
publishing {
publications {
create<MavenPublication>("kafka-topic-config") {
from(components["java"])
// artifact(tasks["sourcesJar"])
// artifact(tasks["javadocJar"])
repositories {
maven {
credentials {
// username = project.property("ossrhUsername").toString()
// password = project.property("ossrhPassword").toString()
username = System.getenv("OSSRHUSERNAME")
password = System.getenv("OSSRPASSWORD")
}
//s01.oss.sonatype.org
val releasesRepoUrl = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
val snapshotsRepoUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
}
}
pom {
name.set("kafka-topic-config")
description.set("support for yaml based Kafka topic configuration")
url.set("https://github.com/simplybusiness/kafka-topic-config")
licenses {
license {
name.set("MIT License")
url.set("https://github.com/simplybusiness/kafka-topic-config#-license")
}
}
developers {
developer {
id.set("jameswalkerdine")
name.set("JamesWalkerdine")
email.set("[email protected]")
url.set("https://github.com/jameswalkerdine")
roles.addAll("developer")
timezone.set("Europe/London")
}
}
scm {
connection.set("scm:git:https://github.com/simplybusiness/kafka-topic-config.git")
developerConnection.set("scm:git:ssh://github.com:jameswalkerdine/kafka-topic-config.git")
url.set("https://github.com/simplybusiness/kafka-topic-config")
}
}
}
}
}
extra["isReleaseVersion"] = !version.toString().endsWith("SNAPSHOT")
signing {
setRequired({
(project.extra["isReleaseVersion"] as Boolean) && gradle.taskGraph.hasTask("publish")
})
sign(publishing.publications["kafka-topic-config"])
}