Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Maven is commonly used for Java packages; Meson is not. Also, Meson's Java support is incomplete and we've had to carry workarounds for adding entries to the JAR manifest.
Historically the built artifact has been called
openslide.jar
. We're already renaming it toopenslide-java-$version.jar
in CI, and Maven prefers to include the version number in the JAR filename. For clarity and consistency, use Maven's defaults with a sensibleartifactId
, building the artifact asopenslide-java-$version.jar
.Allow Maven to add its usual additional metadata to the JAR, including a couple
MANIFEST.MF
properties and a complete copy ofpom.xml
.Document selecting the correct JDK version at build time, if needed. Maven does not necessarily run on the latest, or default, JDK on the system (e.g. Fedora pins it to an older LTS), so it may be necessary to explicitly set
JAVA_HOME
.We don't learn that our JDK is too old until we try to compile with it. The Maven toolchains mechanism could prevent this, but toolchains are not autodiscovered: they must be explicitly configured by the environment, which often does not do this. (In GitHub Actions,
actions/setup-java
does set up a toolchains file, but Fedora and Ubuntu do not.) If we declared a toolchain dependency, we would require the user to set up a toolchains file before building; it's easier to not do this, and fail at build time if Java is too old.Maven prints warnings unless
pom.xml
hardcodes version numbers for every plugin mentioned there. If version numbers are specified, Maven fetches and runs exactly those plugin versions, with no way to smoothly use the latest available version. Maven calls these version pins a "good practice", but really they're an antipattern that encourages continued reliance on old versions of build tooling, making the ecosystem more brittle. Mitigate as best we can: hardcode plugin versions to avoid the warning, then enable monthly Dependabot version updates so we don't retain pins to stale versions.Closes: #68