From 2a1ed4ffd392167a47fac340eb8cc71c778e4111 Mon Sep 17 00:00:00 2001 From: BenCodez <17074231+BenCodez@users.noreply.github.com> Date: Sat, 12 Sep 2026 17:53:25 -0600 Subject: [PATCH 1/3] Filter embedded optional dependencies --- AdvancedCore/pom.xml | 13 ++++++++++++- docs/jar-packaging.md | 7 ++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/AdvancedCore/pom.xml b/AdvancedCore/pom.xml index 5da0a89b2..68e4ebd49 100644 --- a/AdvancedCore/pom.xml +++ b/AdvancedCore/pom.xml @@ -101,6 +101,18 @@ + + + com.bencodez:simpleapi + + org/bouncycastle/** + com/bencodez/simpleapi/servercomm/http/** + redis/clients/** + org/eclipse/paho/** + META-INF/versions/** + + *:* @@ -239,7 +251,6 @@ com.bencodez simpleapi 1.0.2-SNAPSHOT - thin compile diff --git a/docs/jar-packaging.md b/docs/jar-packaging.md index 0057fdad9..ee2049ed1 100644 --- a/docs/jar-packaging.md +++ b/docs/jar-packaging.md @@ -1,8 +1,9 @@ # JAR packaging contract -AdvancedCore consumes SimpleAPI's `thin` classifier so Maven Shade sees the -project classes and each dependency exactly once. The normal SimpleAPI artifact -remains a self-contained compatibility artifact for other consumers. +AdvancedCore consumes SimpleAPI's normal self-contained artifact for SNAPSHOT +compatibility, then applies an artifact-specific Shade filter for features it +does not use. This also removes content already embedded upstream, which Maven +dependency exclusions alone cannot affect. AdvancedCore does not use SimpleAPI's HTTP, Redis, or MQTT implementations. Its SimpleAPI dependency therefore excludes Bouncy Castle, Jedis, and Paho. From 52f924294a2978e758251c670f9ce6317a809f65 Mon Sep 17 00:00:00 2001 From: BenCodez <17074231+BenCodez@users.noreply.github.com> Date: Sat, 12 Sep 2026 18:05:52 -0600 Subject: [PATCH 2/3] Keep embedded SimpleAPI non-transitive --- AdvancedCore/pom.xml | 3 +++ docs/jar-packaging.md | 3 +++ 2 files changed, 6 insertions(+) diff --git a/AdvancedCore/pom.xml b/AdvancedCore/pom.xml index 68e4ebd49..0d0059653 100644 --- a/AdvancedCore/pom.xml +++ b/AdvancedCore/pom.xml @@ -252,6 +252,9 @@ simpleapi 1.0.2-SNAPSHOT compile + + true org.bouncycastle diff --git a/docs/jar-packaging.md b/docs/jar-packaging.md index ee2049ed1..7bdf7fd8e 100644 --- a/docs/jar-packaging.md +++ b/docs/jar-packaging.md @@ -7,6 +7,9 @@ dependency exclusions alone cannot affect. AdvancedCore does not use SimpleAPI's HTTP, Redis, or MQTT implementations. Its SimpleAPI dependency therefore excludes Bouncy Castle, Jedis, and Paho. +The dependency is published as optional because the required SimpleAPI classes +are embedded in AdvancedCore's JAR; this prevents downstream shading builds from +pulling the original unfiltered SimpleAPI JAR back into their distributions. Hikari, FoliaLib, Configurate, and UniDialog remain available because the AdvancedCore API and implementation use them. Hikari and FoliaLib retain their existing `com.bencodez.simpleapi.*` relocated package names. From fd50e81f802bb3bb5938df51323d6d576a9f7de5 Mon Sep 17 00:00:00 2001 From: BenCodez <17074231+BenCodez@users.noreply.github.com> Date: Sat, 12 Sep 2026 18:12:56 -0600 Subject: [PATCH 3/3] Preserve the AdvancedCore dependency contract --- AdvancedCore/pom.xml | 15 --------------- .../tests/packaging/PackagedArtifactTest.java | 11 ++--------- docs/jar-packaging.md | 17 ++++++++--------- 3 files changed, 10 insertions(+), 33 deletions(-) diff --git a/AdvancedCore/pom.xml b/AdvancedCore/pom.xml index 0d0059653..366d21c6c 100644 --- a/AdvancedCore/pom.xml +++ b/AdvancedCore/pom.xml @@ -101,18 +101,6 @@ - - - com.bencodez:simpleapi - - org/bouncycastle/** - com/bencodez/simpleapi/servercomm/http/** - redis/clients/** - org/eclipse/paho/** - META-INF/versions/** - - *:* @@ -252,9 +240,6 @@ simpleapi 1.0.2-SNAPSHOT compile - - true org.bouncycastle 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 ed1098e10..bb22288a5 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 @@ -1,6 +1,5 @@ package com.bencodez.advancedcore.tests.packaging; -import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -15,7 +14,7 @@ public class PackagedArtifactTest { @Test - void keepsRequiredRelocatedLibrariesWithoutOptionalTransports() throws Exception { + void keepsRequiredClassesAndRelocations() throws Exception { Path artifactPath = packagedJar(); try (JarFile artifact = new JarFile(artifactPath.toFile())) { assertNotNull(artifact.getEntry("com/bencodez/advancedcore/AdvancedCorePlugin.class")); @@ -27,14 +26,8 @@ void keepsRequiredRelocatedLibrariesWithoutOptionalTransports() throws Exception assertNull(artifact.getEntry("com/tcoded/folialib/FoliaLib.class")); assertNull(artifact.getEntry("com/zaxxer/hikari/HikariDataSource.class")); assertNull(artifact.getEntry("org/mozilla/javascript/Context.class")); - assertFalse(artifact.stream().anyMatch(entry -> entry.getName().startsWith("org/bouncycastle/"))); - assertFalse(artifact.stream().anyMatch(entry -> entry.getName() - .startsWith("com/bencodez/simpleapi/servercomm/http/"))); - assertFalse(artifact.stream().anyMatch(entry -> entry.getName().startsWith("redis/clients/"))); - assertFalse(artifact.stream().anyMatch(entry -> entry.getName().startsWith("org/eclipse/paho/"))); - assertFalse(artifact.stream().anyMatch(entry -> entry.getName().startsWith("META-INF/versions/25/"))); } - System.out.printf("AdvancedCore packaged artifact: %,d bytes; optional HTTP/Redis/MQTT payload absent%n", + System.out.printf("AdvancedCore packaged artifact: %,d bytes; required classes and relocations retained%n", Files.size(artifactPath)); } diff --git a/docs/jar-packaging.md b/docs/jar-packaging.md index 7bdf7fd8e..f79c86596 100644 --- a/docs/jar-packaging.md +++ b/docs/jar-packaging.md @@ -1,15 +1,12 @@ # JAR packaging contract AdvancedCore consumes SimpleAPI's normal self-contained artifact for SNAPSHOT -compatibility, then applies an artifact-specific Shade filter for features it -does not use. This also removes content already embedded upstream, which Maven -dependency exclusions alone cannot affect. +compatibility and preserves the established transitive dependency contract. +It does not add an AdvancedCore-specific payload filter or change dependency +publication semantics for existing consumers. AdvancedCore does not use SimpleAPI's HTTP, Redis, or MQTT implementations. Its SimpleAPI dependency therefore excludes Bouncy Castle, Jedis, and Paho. -The dependency is published as optional because the required SimpleAPI classes -are embedded in AdvancedCore's JAR; this prevents downstream shading builds from -pulling the original unfiltered SimpleAPI JAR back into their distributions. Hikari, FoliaLib, Configurate, and UniDialog remain available because the AdvancedCore API and implementation use them. Hikari and FoliaLib retain their existing `com.bencodez.simpleapi.*` relocated package names. @@ -19,6 +16,8 @@ that contain Gson types, while the supported server/proxy platforms supply it. Rhino remains bundled and relocated for the JavaScript feature. The package phase runs `PackagedArtifactTest` after shading. It verifies the -actual minimized JAR contains required relocated classes and no HTTP crypto, -Redis, MQTT, or Java 25 Bouncy Castle payload. Deployment profiles use the same -Shade configuration; only publication/final-name behavior differs. +actual minimized JAR contains its required classes and relocations. VotingPlugin +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.