From 41fa392384a72eefd75a486dd8586d99de148b72 Mon Sep 17 00:00:00 2001 From: Ben Date: Sun, 15 Nov 2026 17:00:21 -0600 Subject: [PATCH 1/3] build: filter optional annotations and unreachable shaded metadata --- AdvancedCore/pom.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/AdvancedCore/pom.xml b/AdvancedCore/pom.xml index b26f1feac..6ab3ea49d 100644 --- a/AdvancedCore/pom.xml +++ b/AdvancedCore/pom.xml @@ -107,6 +107,16 @@ META-INF/*.SF META-INF/*.DSA META-INF/*.RSA + + META-INF/versions/** + module-info.class + + org/checkerframework/** + org/jspecify/** + + META-INF/maven/**/pom.xml + META-INF/maven/**/pom.properties From d71749c1b05999080518ef4b36256cf825cedae6 Mon Sep 17 00:00:00 2001 From: Ben Date: Sun, 15 Nov 2026 17:00:24 -0600 Subject: [PATCH 2/3] test: assert slim artifact keeps Redis MQTT HTTP Rhino and Folia APIs --- .../tests/packaging/PackagedArtifactTest.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/packaging/PackagedArtifactTest.java b/AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/packaging/PackagedArtifactTest.java index d8c1e0d18..660b899ed 100644 --- a/AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/packaging/PackagedArtifactTest.java +++ b/AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/packaging/PackagedArtifactTest.java @@ -30,10 +30,29 @@ void keepsRequiredClassesAndRelocations() throws Exception { assertNotNull(artifact.getEntry("com/bencodez/simpleapi/folialib/FoliaLib.class")); assertNotNull(artifact.getEntry("com/bencodez/simpleapi/hikari/HikariDataSource.class")); assertNotNull(artifact.getEntry("com/bencodez/advancedcore/rhino/Context.class")); + // The normal published AdvancedCore JAR must retain the transport APIs + // embedded in SimpleAPI; downstream consumers load these in isolation. + assertNotNull(artifact.getEntry("redis/clients/jedis/HostAndPort.class")); + assertNotNull(artifact.getEntry("org/eclipse/paho/client/mqttv3/MqttClient.class")); + assertNotNull(artifact.getEntry("com/bencodez/simpleapi/servercomm/http/HttpTlsIdentity.class")); assertNull(artifact.getEntry("com/tcoded/folialib/FoliaLib.class")); assertNull(artifact.getEntry("com/zaxxer/hikari/HikariDataSource.class")); assertNull(artifact.getEntry("org/mozilla/javascript/Context.class")); + assertTrue(artifact.getManifest() != null); + assertTrue(!"true".equalsIgnoreCase( + artifact.getManifest().getMainAttributes().getValue("Multi-Release")), + "Versioned implementations cannot be filtered from a multi-release JAR"); + assertTrue(artifact.stream().noneMatch(entry -> entry.getName().startsWith("META-INF/versions/") + || entry.getName().equals("module-info.class")), + "The shaded distribution must not contain unreachable module payload"); + assertTrue(artifact.stream().noneMatch(entry -> entry.getName().startsWith("org/checkerframework/") + || entry.getName().startsWith("org/jspecify/")), + "Optional annotation libraries should not be embedded"); + assertTrue(artifact.stream().noneMatch(entry -> entry.getName().startsWith("META-INF/maven/") + && (entry.getName().endsWith("/pom.xml") + || entry.getName().endsWith("/pom.properties"))), + "Dependency Maven descriptors should not be embedded"); } System.out.printf("AdvancedCore packaged artifact: %,d bytes; required classes and relocations retained%n", Files.size(artifactPath)); From 1ef438a22cbbee834c5154bd601eefa83bc65666 Mon Sep 17 00:00:00 2001 From: Ben Date: Sun, 15 Nov 2026 17:00:26 -0600 Subject: [PATCH 3/3] docs: record targeted shade filters and producer compatibility boundary --- docs/jar-packaging.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/jar-packaging.md b/docs/jar-packaging.md index f79c86596..f2d5ee3f1 100644 --- a/docs/jar-packaging.md +++ b/docs/jar-packaging.md @@ -21,3 +21,27 @@ applies its own narrow artifact filters when producing its smaller user-facing distribution. Deployment profiles use the same Shade configuration; only publication/final-name behavior differs. + +## Additional safe-to-test size filtering + +The normal AdvancedCore artifact embeds SimpleAPI's full published +implementation and must retain its legacy Redis classes, HTTP TLS classes, +and MQTT classes for downstream consumers, even though AdvancedCore itself does +not call those transports. Do not strip them solely on local source reachability. + +The shaded JAR is not a multi-release JAR or JPMS module, so the Maven Shade +filters omit `META-INF/versions/**` and root `module-info.class`. Redundant +dependency `META-INF/maven/**/pom.xml` and `pom.properties` descriptions +are also omitted; service files, version fallbacks, licenses, native resources, +and deployed plugin metadata remain. + +Checker Framework and JSpecify annotation implementation packages are filtered +from the shaded JAR, rather than changing the Java dependency graph or published +method signatures. If an external consumer compiles directly against those +annotation types, it must declare the separate annotation dependency; that +source-compatibility edge remains a review consideration. + +Use `mvn -B -f AdvancedCore/pom.xml clean package` and check both +`PackagedArtifactTest` and VotingPlugin's packaged producer-compatibility test +before accepting an artifact change. The suite exercises class loading but does +not substitute for live Bukkit/Paper/Folia startup validation.