On 06.04.2023 13:56, Julian Reschke wrote:
Hi everybody,

as some have noticed, we have begun the migration away from Guava 15.0
to a *shaded* version of Guava (latest and greatest).

A new subproject has been added (oak-shaded-guava), which repackages
Guava 31 under the package name o.a.jackrabbit.guava. See
<https://issues.apache.org/jira/browse/OAK-9989> for details and
discussion.

If your IDE acts weird (be it Eclipse or IntelliJ), it's because it does
not understand the shaded subproject. Sorry for that. While there's no
fix for the IDEs, the workaround is to disable oak-shaded-guava
(Intellij) or remove it (Eclipse) - after having built it locally with
Maven.

We may decide at a later point to work around this by moving this out of
the reactor pom.

What's next?

1) We have a few sub projects that currently expose Guava in APIs; these
APIs have been deprecated for long, and I'll remove those APIs *after*
the next release (1.52.0).

2) In the meantime, everybody can help by converting "their" sub
projects. (If you do so, please add a sub-task to
<https://issues.apache.org/jira/browse/OAK-7182>). This usually means
adding the dependency to the POM, and rewriting import statements. I
usually just run:

~~~
#!/bin/bash

find . -name "*.java" -exec sed
"s/^import\scom\.google\.common\.\(.*;\)/import
org.apache.jackrabbit.guava.common.\1/g" -i {} ";"
find . -name "*.java" -exec sed
"s/^import\sstatic\scom\.google\.common\.\(.*;\)/import static
org.apache.jackrabbit.guava.common.\1/g" -i {} ";"
~~~

WARNING: this is destructive. Only run it on a Git checkout with no
local changes, and do not do it inside your project root. You have been
warned.

After running this, you may find that a Guava 15 method actually has
been removed. Usually googling for the method signature will tell you
what happened.

For the modules where I already did the conversion, I also took the
opportunity to convert things to standard JDK 11 lingo where simple.
https://issues.apache.org/jira/browse/OAK-10180 /
https://github.com/apache/jackrabbit-oak/pull/890 is a good example for
that.

The currently planned timeline is:

1.52.0 (May?): release with shaded guava subproject and as many
subprojects converted as possible

1.54.0 (July?): remove deprecated APIs exposing native Guava

1.56.0: completely get rid of our Guava 15 dependency, only use the
shaded variant.

Feedback either here or in
<https://issues.apache.org/jira/browse/OAK-7182> appreciated.

We have made good progress, but as usual, things take longer than expected.

We have a pending PR for fixing oak-commons
(https://issues.apache.org/jira/browse/OAK-10247), but I could not apply
it yet (due to the current status of a certain downstream project).

The current plan is to cut 1.54.0 once this has been done (early July),
and then do the remaining changes in 1.56.0.

Best regards, Julian

Reply via email to