Skip to content

Commit

Permalink
feat: add maven publish
Browse files Browse the repository at this point in the history
  • Loading branch information
bruuuuuuuce authored Jul 28, 2021
2 parents 95a057e + 2be378a commit 22cb1ee
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
35 changes: 34 additions & 1 deletion lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,46 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat

plugins {
`java-library`
`maven-publish`
idea
java
}

group = "org.momento"
version = findProperty("version") as String

var awsAccessKeyId = System.getenv("AWS_ACCESS_KEY_ID") ?: findProperty("aws_access_key_id") as String? ?: ""
var awsSecretAccessKey = System.getenv("AWS_SECRET_ACCESS_KEY") ?: findProperty("aws_secret_access_key") as String? ?: ""

repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
maven {
name = "client-sdk-java"
url = uri("s3://artifact-814370081888-us-west-2/client-sdk-java/release")
credentials(AwsCredentials::class) {
accessKey = awsAccessKeyId
secretKey = awsSecretAccessKey
}
}
}

publishing {
publications {
create<MavenPublication>("myLibrary") {
from(components["java"])
}
}

repositories {
maven {
url = uri("s3://artifact-814370081888-us-west-2/client-sdk-java/release")
credentials(AwsCredentials::class) {
accessKey = awsAccessKeyId
secretKey = awsSecretAccessKey
}
}
}
}

java {
Expand All @@ -31,4 +64,4 @@ tasks.test {
exceptionFormat = TestExceptionFormat.FULL
events("passed", "skipped", "failed")
}
}
}
4 changes: 2 additions & 2 deletions lib/src/test/java/client/sdk/java/ScsClientTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void testBlockingClientHappyPath() {
ClientSetResponse setRsp = c.set(
key,
ByteBuffer.wrap("bar".getBytes(StandardCharsets.UTF_8)),
1
10
);
Assertions.assertEquals(Result.Ok, setRsp.getResult());

Expand All @@ -57,7 +57,7 @@ void testAsyncClientHappyPath() {
CompletionStage<ClientSetResponse> setRsp = c.setAsync(
key,
ByteBuffer.wrap("bar".getBytes(StandardCharsets.UTF_8)),
1
10
);
Assertions.assertEquals(Result.Ok, setRsp.toCompletableFuture().get().getResult());

Expand Down

0 comments on commit 22cb1ee

Please sign in to comment.