This reverts the main part of commit 95a380b372,
i.e. all of the Java changes are reverted.
Got conflict when reverting the whole commit, so I had to add
the dependency towards JPF to the osmosis-core/build.gradle file
manually.
The existing Maven publishing configuration was quite old and with the
current version of Gradle only publishes the POM file. This change
updates the config to follow the latest docs for maven-publish plugin
and publishes all artefacts again.
Use the Gradle Application plugin to generate the distribution. This has
a number of advantages including much simpler Gradle configuration,
elimination of Plexus Classworlds bootstrap, more mature/tested launch
scripts.
There are some differences in the generated archives including
incorporation of a base path in all files names (probably a good thing),
elimination of /bin/extract* launch scripts (unlikely to be used any
more), and creation of a tar instead of tgz (not a major issue).
Modify Gradle build to use Java 17 source compatibility. This will
unlock the ability to use new language features that have appeared in
Java since Java 8.
The sourcesJar task packages up files including those generated by the
generateJavaSources and generateResources tasks. This dependency must be
explicitly declared otherwise build warnings occur and some Gradle
optimisations are auto disabled.
jcenter is not available from Gradle 8 so needs to be removed.
The shadow plugin is the only dependency retrieved from jcenter. I have
removed it for the moment because I don't understand why it is required
and why standard Maven dependency management can't be used to retrieve
dependencies. If it is required an alternative repo hosting it will need
to be used.
This new approach fixes compiler warnings by making sure that all
ReleasableIterator instances are closed rather than ignoring the
DeltaToDiffReader which doesn't hold any heavyweight resources.
Several queries assume that a value will be loaded from the database.
This logic has been improved to include an error message if a
NullPointerException is thrown. It eliminates IDE/compiler warnings.
Object.finalize has been deprecated as of Java 9. It was only being used
in the various DatabaseContext instances as a last resort cleanup if
resources weren't closed explicitly.
This is a minor version upgrade but will help uncover issues preventing
an upgrade to 8.
A newer version of Checkstyle has been included by Gradle and requires
some minor syntax changes for the JavadocMethod check.
Java 17 is the latest LTS release so will be around for a number of
years.
I have chosen to use the Temurin distribution because it appears to be a
good sensible default according to https://whichjdk.com/
I have included an SDKMAN config file to make it easier to install and
select the right version of Java locally.