New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java: Publish JAR to local Maven repository #1373
Java: Publish JAR to local Maven repository #1373
Conversation
Java: Publish JAR to local Maven repository
finalizedBy 'build' | ||
} | ||
|
||
compileJava.dependsOn('protobuf') | ||
clean.dependsOn('cleanProtobuf', 'cleanRust') | ||
test.dependsOn('buildRust') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the test task no longer build rust or does it still happen even when we remove this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're using release builds, so the buildRust task is not needed (it builds debug only).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but we still want to keep non-release build for development
java/client/build.gradle
Outdated
@@ -2,8 +2,9 @@ import java.nio.file.Paths | |||
|
|||
plugins { | |||
id 'java-library' | |||
id 'maven-publish' | |||
id 'signing' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't sign yet
java/client/build.gradle
Outdated
repositories { | ||
maven { | ||
url = 'https://aws.oss.sonatype.org/service/local/staging/deploy/maven2/' | ||
credentials(PasswordCredentials) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We dont have this yet, may be worth placing a TODO
But... we can try copy that from another repo on aws, e.g.
https://github.com/aws/aws-sdk-java-v2/blob/019159d4bd88b7739e122189bec469cc39ea8bd5/buildspecs/resources/release-settings.xml#L4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found better example https://github.com/aws/amazon-neptune-jdbc-driver/blob/develop/build.gradle
java/client/build.gradle
Outdated
tasks.register('buildWithRust') { | ||
dependsOn 'buildRust' | ||
finalizedBy 'build' | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we still need to keep non-release build for development, why is it being removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We haven't actually been using the debug build for development. I can keep it though if you really want.
java/client/build.gradle
Outdated
from components.java | ||
groupId = 'software.amazon.glide' | ||
artifactId = 'glide' | ||
version = "0.0.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to 255.255.255, we don't want to hardcode the version number of each of the wrappers, instead we change in the CD workflow.
When you'll add a github action to actually publish to maven, we will need to override it inside the workflow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a DEVELOPER.md file with instructions how to build to local repo and how to find the jar. Added some notes - make sure not to remove the non-release build. The rust release build is really slow and should only be used for actual release / benchmarks, not for development
I can keep the debug builds, but the team thinks the DEVELOPER.md should be in a separate PR. |
* Package glide_rs dylib with JAR and autoload it * Clean up build.gradle * Clean up NativeUtils and update README and example build.gradle * Run spotless * Fix Gradle build for tests * Make sure to publish to local Maven repo before running tests * Change com.babushka groupId to software.amazon * Update example build.gradle * Address PR comments * Try to fix build failures in CI * Remove unneeded dependencies * Remove buildRust Gradle task * Update build.gradle in accordance with Maven Central publishing documentation * Remove info for publishing to Maven Central from build.gradle * Readd newline * Fix build * Address PR comments * Run spotless
Issue #, if available:
N/A
This change publishes the Java glide client JAR to the local Maven repository. The built JAR file contains the Rust native lib code. This is not portable, so we will need to ensure that we build one JAR per supported platform.
I was unable to add the signing section to the
build.gradle
since it was causing errors when trying to build the client.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.