1+ import com.vanniktech.maven.publish.SonatypeHost
2+ import com.vanniktech.maven.publish.JavaLibrary
3+ import com.vanniktech.maven.publish.JavadocJar
4+
5+ plugins {
6+ id 'java'
7+ id 'com.adarshr.test-logger' version '4.0.0'
8+ id 'com.google.protobuf' version '0.9.2'
9+ id "com.vanniktech.maven.publish" version "0.31.0"
10+ }
11+
12+ compileJava {
13+ sourceCompatibility = 21
14+ targetCompatibility = 21
15+ }
16+
17+ group = 'com.p14n'
18+ version = '1.0.1-SNAPSHOT'
19+
20+ repositories {
21+ mavenCentral()
22+ }
23+
24+ dependencies {
25+ implementation 'io.debezium:debezium-api:3.0.1.Final'
26+ implementation ('io.debezium:debezium-embedded:3.0.1.Final') {
27+ exclude group: 'org.glassfish.jersey.containers', module: 'jersey-container-servlet'
28+ exclude group: 'org.glassfish.jersey.inject', module: 'jersey-hk2'
29+ exclude group: 'org.eclipse.jetty'
30+ }
31+ implementation 'io.debezium:debezium-connector-postgres:3.0.1.Final'
32+ implementation 'io.debezium:debezium-storage-jdbc:3.0.1.Final'
33+ implementation 'org.slf4j:slf4j-api:2.0.9'
34+ implementation 'com.zaxxer:HikariCP:6.2.1'
35+
36+ constraints {
37+ implementation 'com.google.guava:guava:32.0.0-jre'
38+ }
39+
40+ // gRPC dependencies
41+ implementation 'io.grpc:grpc-netty-shaded:1.53.0'
42+ implementation 'io.grpc:grpc-protobuf:1.53.0'
43+ implementation 'io.grpc:grpc-stub:1.53.0'
44+ implementation 'io.grpc:grpc-api:1.53.0'
45+
46+ implementation 'javax.annotation:javax.annotation-api:1.3.2'
47+
48+ // For code generation
49+ implementation 'com.google.protobuf:protobuf-java:3.21.7'
50+
51+ testImplementation platform('io.zonky.test.postgres:embedded-postgres-binaries-bom:16.2.0')
52+ testImplementation 'io.zonky.test:embedded-postgres:2.0.7'
53+ testImplementation 'net.jqwik:jqwik:1.8.2'
54+ testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0'
55+ testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.0'
56+ testRuntimeOnly 'ch.qos.logback:logback-classic:1.4.11'
57+ testImplementation 'org.mockito:mockito-core:3.12.4'
58+
59+ // OpenTelemetry core dependencies
60+ implementation 'io.opentelemetry:opentelemetry-api:1.32.0'
61+
62+ // Instrumentation for GRPC
63+ implementation 'io.opentelemetry.instrumentation:opentelemetry-grpc-1.6:1.32.0-alpha'
64+
65+ }
66+
67+ testlogger {
68+ theme 'standard'
69+ showExceptions true
70+ showStackTraces true
71+ showFullStackTraces false
72+ showCauses true
73+ slowThreshold 2000
74+ showSummary true
75+ showSimpleNames false
76+ showPassed true
77+ showSkipped true
78+ showFailed true
79+ showStandardStreams false
80+ showPassedStandardStreams true
81+ showSkippedStandardStreams true
82+ showFailedStandardStreams true
83+ }
84+
85+ test {
86+ useJUnitPlatform {
87+ includeEngines 'jqwik', 'junit-jupiter'
88+ }
89+ maxHeapSize = "1G"
90+ minHeapSize = "512M"
91+ maxParallelForks = 1
92+ failFast = true
93+ testLogging.showStandardStreams = true
94+ }
95+
96+ task fastTest( type: Test ) {
97+ useJUnitPlatform {
98+ includeEngines 'junit-jupiter'
99+ exclude '**/dst/**'
100+
101+ }
102+ }
103+
104+ jar {
105+ manifest {
106+ }
107+ }
108+
109+ // Configure Protobuf plugin
110+ protobuf {
111+ protoc {
112+ artifact = 'com.google.protobuf:protoc:3.21.7'
113+ }
114+ plugins {
115+ grpc {
116+ artifact = 'io.grpc:protoc-gen-grpc-java:1.53.0'
117+ }
118+ }
119+ generateProtoTasks {
120+ all()*.plugins {
121+ grpc {}
122+ }
123+ }
124+ }
125+
126+ sourceSets {
127+ main {
128+ java {
129+ srcDirs 'build/generated/source/proto/main/grpc'
130+ srcDirs 'build/generated/source/proto/main/java'
131+ }
132+ }
133+ }
134+
135+ tasks.withType(Jar) {
136+ duplicatesStrategy = DuplicatesStrategy.EXCLUDE
137+ }
138+
139+ javadoc {
140+ exclude "**/grpc/**"
141+ source = sourceSets.main.allJava
142+ }
143+
144+ mavenPublishing {
145+
146+ configure(new JavaLibrary(new JavadocJar.Javadoc(), true))
147+
148+ publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, true)
149+
150+ signAllPublications()
151+
152+ coordinates("com.p14n", "postevent", version)
153+
154+ pom {
155+ name = "Postevent"
156+ description = 'A reliable event publishing and consumption system using PostgreSQL and gRPC'
157+ inceptionYear = "2025"
158+ url = "https://github.com/p14n/postevent/"
159+ licenses {
160+ license {
161+ name = 'MIT License'
162+ url = 'https://opensource.org/licenses/MIT'
163+ }
164+ }
165+ developers {
166+ developer {
167+ id = 'p14n'
168+ name = 'Dean Chapman'
169+ email = 'dean@p14n.com'
170+ }
171+ }
172+ scm {
173+ connection = 'scm:git:git://github.com/p14n/postevent.git'
174+ developerConnection = 'scm:git:ssh://github.com:p14n/postevent.git'
175+ url = 'https://github.com/p14n/postevent'
176+ }
177+ }
178+ }
0 commit comments