-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Confusing artifact name for caffeine guava adapter: guava-<version>.jar #364
Comments
Thanks! I hadn't considered the artifacts being cobbled together in a single directory for the distribution. At build time they are separated by Maven/Gradle/etc into coordinate named directories. The archive name going forward will follow your suggestion. |
Revert "Optimize entry size when the singleton weigher is used" This reverts commit 37f6ad3.
This will have to wait until 3.0 since it changes the Maven coordinate. Ideally the |
The simplest solution would be to move off of the Guava adapters. That change shouldn't be too hard and drops the dependency, thereby avoiding this confusion. |
We can't do it yet, because one single cache implementation in Gerrit is not recursion free. This is the tracking issue: [1]. For that reason, we switched That why we still need Guava adapters for not intrusive changes to support per cache switch. Any ETA for the fix here? Because we have to do some build acrobatic with artifact fetch and rename, we are hitting some Bazel specific issues: [3]. With the dedicated GAV: CAFFEINE_VERS = "3.0.0"
maven_jar(
name = "caffeine",
artifact = "com.github.ben-manes.caffeine:caffeine-guava-adapter:" + CAFFEINE_VERS,
sha1 = <SHA1>,
) [1] https://bugs.chromium.org/p/gerrit/issues/detail?id=11900 |
When I looked into this previously, Maven's perspective on this is that the consuming build should rename it if there is a desire to qualify the file name. For example the WAR plugin offers outputFileNameMapping to resolve this. The Gradle team appears to make the same argument based on following the Maven team's decisions on this topic, e.g. for its WAR plugin. So while inconvenient and an annoyance of how Maven decided to name jars in the repository format, it appears to be left to the build tool to rectify if need be. It would be a breaking change to blindly rename the artifact. If that was done or both coordinates were produced, it would violate the Jigsaw module rules where both jars could be on the classpath (as different coordinates) and own the same package. The only safe solution is if we instead provided the classes in a new package under a new coordinate. Renaming when creating the WAR appears to be the consensus of build tools and seems like the best of the bad options at our disposal. |
Ping. Any progress here or ETA? |
I have no plans to break compatibility. As described above, this is not a safe change. It is up to the build system to decide how it packages jars and both Maven and Gradle suggest using a custom mapping rule. It was an unfortunate oversight in the initial naming, but the responsibility of the build tool which has the coordinates to work from. |
Closing due to being backwards incompatible, that build systems consider it the consumer's responsibility (and make it easy to resolve), and that the impact poses no harm. |
While trying to integrate Caffeine in Gerrit Code Review, we discovered that Caffeine Guava adapter library has the final artifact
guava
and can be easily confused with the Google's library.Before integration with Caffeine, the
gerrit.war
has two artifacts with guava in its name:After the integration we have 3:
It would be better to rename the guava artifact in Caffeine project to
caffeinated-guava
orcaffeine-guava-adapter
or some such to avoid potential collision.Say at some point, both projects have reached version 42. In this case we would have a collision, and would require some hacks during the build process, like renaming the artifact names fetched from Maven Central or similar.
The text was updated successfully, but these errors were encountered: