-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 to openslide-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 sensible artifactId, building the artifact as openslide-java-$version.jar. Allow Maven to add its usual additional metadata to the JAR, including a couple MANIFEST.MF properties and a complete copy of pom.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 Signed-off-by: Benjamin Gilbert <[email protected]>
- Loading branch information
Showing
8 changed files
with
137 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: 2 | ||
updates: | ||
# Periodically check for Maven plugin updates | ||
- package-ecosystem: maven | ||
directory: / | ||
schedule: | ||
interval: monthly | ||
commit-message: | ||
prefix: maven |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<version>0.12.4</version> | ||
|
||
<groupId>org.openslide</groupId> | ||
<artifactId>openslide-java</artifactId> | ||
<name>OpenSlide Java</name> | ||
<description>Java interface to OpenSlide</description> | ||
<url>https://openslide.org</url> | ||
<inceptionYear>2007</inceptionYear> | ||
<organization> | ||
<name>OpenSlide project</name> | ||
<url>https://openslide.org</url> | ||
</organization> | ||
<licenses> | ||
<license> | ||
<name>LGPL-2.1-only</name> | ||
<url>https://raw.githubusercontent.com/openslide/openslide-java/main/COPYING.LESSER</url> | ||
<distribution>repo</distribution> | ||
</license> | ||
</licenses> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<maven.compiler.source>22</maven.compiler.source> | ||
<maven.compiler.target>22</maven.compiler.target> | ||
</properties> | ||
|
||
<build> | ||
<defaultGoal>package</defaultGoal> | ||
<sourceDirectory>.</sourceDirectory> | ||
|
||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.13.0</version> | ||
<configuration> | ||
<showWarnings>true</showWarnings> | ||
<compilerArgs> | ||
<arg>-Xlint:all,-serial</arg> | ||
</compilerArgs> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<version>3.3.0</version> | ||
<configuration> | ||
<archive> | ||
<manifest> | ||
<addDefaultImplementationEntries>true</addDefaultImplementationEntries> | ||
<mainClass>org.openslide.gui.Demo</mainClass> | ||
</manifest> | ||
<manifestEntries> | ||
<Enable-Native-Access>ALL-UNNAMED</Enable-Native-Access> | ||
</manifestEntries> | ||
</archive> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<distributionManagement> | ||
<downloadUrl>https://openslide.org/download/#source</downloadUrl> | ||
</distributionManagement> | ||
|
||
<scm> | ||
<connection>scm:git:https://github.com/openslide/openslide-java</connection> | ||
<url>https://github.com/openslide/openslide-java</url> | ||
</scm> | ||
|
||
<issueManagement> | ||
<system>GitHub</system> | ||
<url>https://github.com/openslide/openslide-java/issues</url> | ||
</issueManagement> | ||
|
||
<ciManagement> | ||
<system>GitHub</system> | ||
<url>https://github.com/openslide/openslide-java/actions</url> | ||
</ciManagement> | ||
|
||
<mailingLists> | ||
<mailingList> | ||
<name>openslide-announce</name> | ||
<subscribe>https://lists.andrew.cmu.edu/mailman/listinfo/openslide-announce</subscribe> | ||
<unsubscribe>https://lists.andrew.cmu.edu/mailman/listinfo/openslide-announce</unsubscribe> | ||
<archive>https://lists.andrew.cmu.edu/pipermail/openslide-announce/</archive> | ||
<otherArchives> | ||
<otherArchive>https://marc.info/?l=openslide-announce</otherArchive> | ||
</otherArchives> | ||
</mailingList> | ||
<mailingList> | ||
<name>openslide-users</name> | ||
<subscribe>https://lists.andrew.cmu.edu/mailman/listinfo/openslide-users</subscribe> | ||
<unsubscribe>https://lists.andrew.cmu.edu/mailman/listinfo/openslide-users</unsubscribe> | ||
<post>[email protected]</post> | ||
<archive>https://lists.andrew.cmu.edu/pipermail/openslide-users/</archive> | ||
<otherArchives> | ||
<otherArchive>https://marc.info/?l=openslide-users</otherArchive> | ||
</otherArchives> | ||
</mailingList> | ||
</mailingLists> | ||
</project> |