Skip to content
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

Merged
merged 20 commits into from May 13, 2024

Conversation

jonathanl-bq
Copy link
Collaborator

@jonathanl-bq jonathanl-bq commented May 2, 2024

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.

@jonathanl-bq jonathanl-bq requested a review from a team as a code owner May 2, 2024 01:09
@Yury-Fridlyand Yury-Fridlyand added java issues and fixes related to the java client CI CI/CD related labels May 2, 2024
finalizedBy 'build'
}

compileJava.dependsOn('protobuf')
clean.dependsOn('cleanProtobuf', 'cleanRust')
test.dependsOn('buildRust')
Copy link
Collaborator

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?

Copy link
Collaborator Author

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).

Copy link
Contributor

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

@@ -2,8 +2,9 @@ import java.nio.file.Paths

plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
Copy link
Collaborator

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

repositories {
maven {
url = 'https://aws.oss.sonatype.org/service/local/staging/deploy/maven2/'
credentials(PasswordCredentials)
Copy link
Collaborator

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

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tasks.register('buildWithRust') {
dependsOn 'buildRust'
finalizedBy 'build'
}
Copy link
Contributor

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?

Copy link
Collaborator Author

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.

from components.java
groupId = 'software.amazon.glide'
artifactId = 'glide'
version = "0.0.1"
Copy link
Contributor

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

Copy link
Contributor

@barshaul barshaul left a 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

java/examples/build.gradle Outdated Show resolved Hide resolved
java/client/build.gradle Show resolved Hide resolved
@jonathanl-bq
Copy link
Collaborator Author

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.

@jonathanl-bq jonathanl-bq merged commit b042ab3 into aws:main May 13, 2024
12 checks passed
avifenesh pushed a commit that referenced this pull request May 14, 2024
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI CI/CD related java issues and fixes related to the java client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants