-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
182 lines (161 loc) · 5.35 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
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
import org.springframework.boot.gradle.plugin.SpringBootPlugin
plugins {
id 'java-library'
id 'org.springframework.boot' version '3.0.2' apply false
id 'signing'
id 'maven-publish'
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0'
id 'com.google.protobuf' version '0.9.2'
}
group 'io.github.leofuso'
version 'v3.0.2.1-SNAPSHOT'
repositories {
mavenCentral()
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
apply plugin: 'io.spring.dependency-management'
dependencyManagement {
imports {
mavenBom SpringBootPlugin.BOM_COORDINATES
}
}
compileJava {
options.compilerArgs << '-parameters'
inputs.files(tasks.named('processResources'))
}
java {
withJavadocJar()
withSourcesJar()
registerFeature('principal') {
usingSourceSet(sourceSets.main)
withJavadocJar()
withSourcesJar()
}
registerFeature('grpcSupport') {
usingSourceSet(sourceSets.main)
withJavadocJar()
withSourcesJar()
}
}
javadoc {
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
dependencies {
/* Spring */
principalImplementation 'org.springframework.boot:spring-boot-starter-web'
principalImplementation 'org.springframework.boot:spring-boot-starter-actuator'
principalImplementation 'org.springframework.boot:spring-boot-starter-validation'
principalImplementation 'org.springframework.kafka:spring-kafka'
principalImplementation 'org.apache.kafka:kafka-streams'
principalImplementation 'com.google.code.findbugs:jsr305:3.0.2'
grpcSupportImplementation 'io.grpc:grpc-protobuf:1.52.1'
grpcSupportImplementation 'io.grpc:grpc-stub:1.52.1'
grpcSupportImplementation 'javax.annotation:javax.annotation-api:1.3.2'
grpcSupportRuntimeElements 'io.grpc:grpc-netty-shaded:1.52.1'
/* Annotation Processors */
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
annotationProcessor 'org.springframework.boot:spring-boot-autoconfigure-processor'
/* Test */
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.kafka:spring-kafka-test'
testImplementation 'io.grpc:grpc-netty-shaded:1.52.1'
}
test {
useJUnitPlatform()
}
/* gRPC Support requires code to be generated based on .proto files, these must be packed together with the lib */
protobuf {
protoc {
artifact = 'com.google.protobuf:protoc:3.21.12'
}
plugins {
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java:1.52.1'
}
}
generateProtoTasks {
all()*.plugins {
grpc {}
}
}
}
publishing {
publications {
sonatype(MavenPublication) {
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = group + ':actuator-kafka-streams'
description = 'Spring Boot actuator endpoints for Kafka Streams.'
url = 'https://github.com/leofuso/actuator-kafka-streams'
packaging 'jar'
issueManagement {
system = 'GitHub Issue Tracking'
url = 'https://github.com/leofuso/actuator-kafka-streams/issues'
}
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'leofuso'
name = 'Leonardo Fuso Nuzzo'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:git://github.com/leofuso/actuator-kafka-streams.git'
developerConnection = 'scm:git:[email protected]:leofuso/actuator-kafka-streams.git'
url = 'https://github.com/LeoFuso/actuator-kafka-streams'
}
}
}
}
repositories {
var isSnapshot = version.endsWith('SNAPSHOT')
if (isSnapshot) {
maven {
url = 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
name = 'SonatypeSnapshot'
credentials(PasswordCredentials.class)
}
} else {
maven {
url = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
name = 'SonatypeRelease'
credentials(PasswordCredentials.class)
}
}
}
}
/*
* Commented out for JitPack's automation, necessary for Sonatype releases.
*
* signing { sign publishing.publications }
*/
nexusPublishing {
repositories {
sonatype {
nexusUrl = uri('https://s01.oss.sonatype.org/service/local/')
snapshotRepositoryUrl = uri('https://s01.oss.sonatype.org/content/repositories/snapshots/')
username = SonatypeReleaseUsername
password = SonatypeReleasePassword
}
}
}