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: Update README for local maven installation instructions #1905

Conversation

acarbonetto
Copy link
Collaborator

No description provided.

Signed-off-by: Andrew Carbonetto <[email protected]>
Signed-off-by: Andrew Carbonetto <[email protected]>
Signed-off-by: Andrew Carbonetto <[email protected]>
@acarbonetto acarbonetto requested a review from a team as a code owner July 9, 2024 18:57
@Yury-Fridlyand Yury-Fridlyand added java issues and fixes related to the java client docs Documentation labels Jul 9, 2024
java/README.md Outdated Show resolved Hide resolved
java/README.md Outdated Show resolved Hide resolved
Signed-off-by: Andrew Carbonetto <[email protected]>
@jamesward
Copy link

Since the artifacts aren't available in Maven Central yet, this is a possible temporary workaround, but I don't think this should go into a README as this is not a typical or recommended way to consume the artifacts.

@acarbonetto
Copy link
Collaborator Author

Since the artifacts aren't available in Maven Central yet, this is a possible temporary workaround, but I don't think this should go into a README as this is not a typical or recommended way to consume the artifacts.

Yes. Agreed. We will want to remove this (or move to the Developer.md for how to use the ExampleApp) as soon as the Maven Central artefacts are up and available.

java/README.md Outdated Show resolved Hide resolved
java/README.md Outdated Show resolved Hide resolved
Signed-off-by: Andrew Carbonetto <[email protected]>
@jamesward
Copy link

I'm having an issue getting classifier resolution to work with this approach. Trying to see if I can make it work with install:install-file and will report back.

@acarbonetto
Copy link
Collaborator Author

acarbonetto commented Jul 10, 2024

I'm having an issue getting classifier resolution to work with this approach. Trying to see if I can make it work with install:install-file and will report back.

You can use (for classifier osx-aarch_64):

mvn install:install-file -Dfile=valkey-glide-1.0.0-osx-aarch_64.jar -DgroupId=io.valkey -DartifactId=valkey-glide -Dversion=1.0.0 -Dpackaging=jar -DpomFile=valkey-glide-1.0.0.pom -Dclassifier=osx-aarch_64

and for dependency:

dependencies {
    implementation group: 'io.valkey', name: 'valkey-glide', version: '1.0.0', classifier: 'osx-aarch_64'
}

@jamesward
Copy link

I'm trying that (but with linux-x86_64) and it isn't quite working in a Gradle project:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileKotlin'.
> Could not resolve all files for configuration ':compileClasspath'.
   > Could not resolve io.valkey:valkey-glide:1.0.0.
     Required by:
         project :
      > A dependency was declared on configuration 'linux-x86_64' which is not declared in the descriptor for io.valkey:valkey-glide:1.0.0.

But actually it looks like the artifacts are now on Maven Central so hopefully this workaround isn't needed anymore. I'll try to use those artifacts now.

@jamesward
Copy link

That error was because I was specifying the classifier in the wrong way in the dependency definition with build.gradle.kts. I did:

implementation("io.valkey", "valkey-glide", "1.0.0", osdetector.classifier)

But that sets the configuration property not the classifier property. doh :(

This works:

implementation("io.valkey", "valkey-glide", "1.0.0", classifier = osdetector.classifier)

And it looks like I can just do:

implementation("io.valkey", "valkey-glide", "1.0.0")

But this might only be working for linux-x86_64 because that is the only artifact with configuration in the Gradle metadata file:
https://repo1.maven.org/maven2/io/valkey/valkey-glide/1.0.0/valkey-glide-1.0.0.module

@jamesward
Copy link

Here is the project that works for me (on linux-x86_64):
https://github.com/jamesward/hello-valkey-glide-kotlin

It'll be interesting to see if the classifier doesn't work for others on different OS / Architectures.

@Yury-Fridlyand
Copy link
Collaborator

I guess that gradle resolves linux-x86_64 version of the module if classifier is omitted.

@@ -47,6 +47,25 @@ java -version

_Note: Publishing to Maven is pending; the examples below will be available once artifacts are published. You can also download artifacts from the [GitHub release](https://github.com/valkey-io/valkey-glide/releases/tag/v1.0.0) and add the jar file to the project._

**Temporary Workaround while Artifacts pending to Maven Central**
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need this PR? GLIDE is already published on maven central.

@sullis
Copy link
Contributor

sullis commented Jul 10, 2024

I am successfully using valkey-glide 1.0.0 in a Maven project:

https://github.com/sullis/valkey-playground/blob/main/pom.xml

I am using os-maven-plugin to get the right classifier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation java issues and fixes related to the java client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants