1+ plugins {
2+ id(" java-library" )
3+ id(" maven-publish" )
4+ }
5+
6+ group = " com.redis"
7+ version = project.findProperty(" version" ) as String? ? : " 0.1.0"
8+ description = " Java client for the Agent Memory Server REST API"
9+
10+ java {
11+ sourceCompatibility = JavaVersion .VERSION_11
12+ targetCompatibility = JavaVersion .VERSION_11
13+ withJavadocJar()
14+ withSourcesJar()
15+ }
16+
17+ repositories {
18+ mavenCentral()
19+ }
20+
21+ dependencies {
22+ // HTTP Client
23+ implementation(" com.squareup.okhttp3:okhttp:4.12.0" )
24+
25+ // JSON Processing
26+ implementation(" com.fasterxml.jackson.core:jackson-databind:2.16.1" )
27+ implementation(" com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.16.1" )
28+
29+ // ULID generation
30+ implementation(" com.github.f4b6a3:ulid-creator:5.2.3" )
31+
32+ // Annotations
33+ compileOnly(" org.jetbrains:annotations:24.1.0" )
34+
35+ // Testing
36+ testImplementation(platform(" org.junit:junit-bom:5.10.0" ))
37+ testImplementation(" org.junit.jupiter:junit-jupiter" )
38+ testRuntimeOnly(" org.junit.platform:junit-platform-launcher" )
39+ testImplementation(" org.mockito:mockito-core:5.8.0" )
40+ testImplementation(" org.mockito:mockito-junit-jupiter:5.8.0" )
41+ testImplementation(" com.squareup.okhttp3:mockwebserver:4.12.0" )
42+
43+ // Testcontainers for integration tests
44+ testImplementation(platform(" org.testcontainers:testcontainers-bom:1.19.3" ))
45+ testImplementation(" org.testcontainers:testcontainers" )
46+ testImplementation(" org.testcontainers:junit-jupiter" )
47+ }
48+
49+ tasks.test {
50+ useJUnitPlatform {
51+ excludeTags(" integration" )
52+ }
53+ }
54+
55+ // Create a separate task for integration tests
56+ tasks.register<Test >(" integrationTest" ) {
57+ description = " Runs integration tests with Testcontainers"
58+ group = " verification"
59+
60+ testClassesDirs = sourceSets[" test" ].output.classesDirs
61+ classpath = sourceSets[" test" ].runtimeClasspath
62+
63+ useJUnitPlatform {
64+ includeTags(" integration" )
65+ }
66+
67+ shouldRunAfter(tasks.test)
68+
69+ // Integration tests may take longer
70+ testLogging {
71+ events(" passed" , " skipped" , " failed" )
72+ showStandardStreams = true
73+ }
74+ }
75+
76+ tasks.withType<JavaCompile > {
77+ options.encoding = " UTF-8"
78+ }
79+
80+ tasks.javadoc {
81+ options {
82+ (this as StandardJavadocDocletOptions ).apply {
83+ addStringOption(" Xdoclint:none" , " -quiet" )
84+ }
85+ }
86+ }
87+
88+ publishing {
89+ publications {
90+ create<MavenPublication >(" mavenJava" ) {
91+ from(components[" java" ])
92+
93+ groupId = project.group.toString()
94+ artifactId = project.name
95+ version = project.version.toString()
96+
97+ pom {
98+ name.set(" Agent Memory Client Java" )
99+ description.set(project.description)
100+ url.set(" https://github.com/redis-developer/agent-memory-server" )
101+ inceptionYear.set(" 2024" )
102+
103+ licenses {
104+ license {
105+ name.set(" Apache License 2.0" )
106+ url.set(" https://www.apache.org/licenses/LICENSE-2.0" )
107+ }
108+ }
109+
110+ developers {
111+ developer {
112+ id.set(" redis" )
113+ name.set(" Brian Sam-Bodden." )
114+ 115+ organization.set(" Redis Inc." )
116+ organizationUrl.set(" https://redis.io" )
117+ }
118+ }
119+
120+ scm {
121+ connection.set(" scm:git:git://github.com/redis-developer/agent-memory-server.git" )
122+ developerConnection.set(" scm:git:ssh://github.com:redis-developer/agent-memory-server.git" )
123+ url.set(" https://github.com/redis-developer/agent-memory-server" )
124+ }
125+ }
126+ }
127+ }
128+
129+ repositories {
130+ maven {
131+ name = " staging"
132+ url = uri(layout.buildDirectory.dir(" staging-deploy" ))
133+ }
134+ }
135+ }
0 commit comments