From 70e1a9facecaada325c899f2f97a71882354bb96 Mon Sep 17 00:00:00 2001 From: BenCodez <17074231+BenCodez@users.noreply.github.com> Date: Sat, 12 Sep 2026 17:52:24 -0600 Subject: [PATCH] Keep packaging optimization independently consumable --- SimpleAPI/pom.xml | 9 -------- .../tests/packaging/FullArtifactTest.java | 22 ------------------- docs/jar-packaging.md | 13 ++--------- 3 files changed, 2 insertions(+), 42 deletions(-) diff --git a/SimpleAPI/pom.xml b/SimpleAPI/pom.xml index bc97dea..d768c4b 100644 --- a/SimpleAPI/pom.xml +++ b/SimpleAPI/pom.xml @@ -97,14 +97,6 @@ - - thin-library - package - jar - - thin - - shared-library-sources package @@ -208,7 +200,6 @@ ${project.build.directory}/full-artifact-reports ${project.build.directory}/${project.build.finalName}.jar - ${project.build.directory}/${project.build.finalName}-thin.jar diff --git a/SimpleAPI/src/test/java/com/bencodez/simpleapi/tests/packaging/FullArtifactTest.java b/SimpleAPI/src/test/java/com/bencodez/simpleapi/tests/packaging/FullArtifactTest.java index a73df7c..d978742 100644 --- a/SimpleAPI/src/test/java/com/bencodez/simpleapi/tests/packaging/FullArtifactTest.java +++ b/SimpleAPI/src/test/java/com/bencodez/simpleapi/tests/packaging/FullArtifactTest.java @@ -62,21 +62,6 @@ public class FullArtifactTest { Files.size(full), retainedEntries, removedEntries, removedCompressedBytes); } - @Test void thinArtifactContainsProjectClassesWithoutEmbeddedDependencies() throws Exception { - Path thin = thinJar(); - try (JarFile artifact = new JarFile(thin.toFile())) { - assertNotNull(artifact.getEntry("com/bencodez/simpleapi/servercomm/http/HttpTlsIdentity.class"), - "Thin artifact must preserve the complete SimpleAPI API"); - assertNotNull(artifact.getEntry("com/bencodez/simpleapi/scheduler/BukkitScheduler.class")); - assertNull(artifact.getEntry("org/bouncycastle/jce/provider/BouncyCastleProvider.class")); - assertNull(artifact.getEntry("com/zaxxer/hikari/HikariDataSource.class")); - assertNull(artifact.getEntry("redis/clients/jedis/Jedis.class")); - assertNull(artifact.getEntry("org/spongepowered/configurate/ConfigurationNode.class")); - assertFalse(artifact.stream().anyMatch(entry -> entry.getName().startsWith("META-INF/versions/"))); - } - System.out.printf("Thin artifact: %,d bytes (project classes only)%n", Files.size(thin)); - } - @Test void packagedTlsWorksWithoutMavenDependencies() throws Exception { Path full = fullJar(); String fixtureName = PackagedTlsSmoke.class.getName(); @@ -120,11 +105,4 @@ private static Path fullJar() { return full; } - private static Path thinJar() { - String value = System.getProperty("simpleapi.thinJar"); - assertNotNull(value, "Run this test through the Maven package lifecycle"); - Path thin = Path.of(value).toAbsolutePath().normalize(); - assertTrue(Files.isRegularFile(thin), "Missing packaged thin artifact: " + thin); - return thin; - } } diff --git a/docs/jar-packaging.md b/docs/jar-packaging.md index 1eac2a2..6932524 100644 --- a/docs/jar-packaging.md +++ b/docs/jar-packaging.md @@ -4,14 +4,6 @@ `shared-sources` classifiers, dependency scopes, and public APIs are unchanged. There are no additional modules or runtime downloads. -The `thin` classifier contains the complete, unshaded SimpleAPI classes and -resources but no embedded third-party classes. It exists for trusted downstream -projects that immediately shade SimpleAPI while explicitly controlling the -ordinary POM's transitive dependencies. It is not a standalone replacement for -the full artifact. In particular, a consumer of HTTP/TLS APIs must still supply -the declared Bouncy Castle libraries. Normal external consumers should continue -to use the self-contained main artifact. - The HTTP transport uses Bouncy Castle for its private CA and certificates. Do not remove those dependencies, switch them to `provided`, strip provider mappings, or enable broad `minimizeJar` without packaged-runtime validation. @@ -38,9 +30,8 @@ git diff --check The package phase runs `FullArtifactTest` after shading, followed by the existing shared-classpath tests. It verifies the non-multi-release manifest, absence of -all unreachable versioned payload, preservation of every base -`org/bouncycastle/` entry from the three resolved BC libraries, and the thin -artifact's no-embedded-dependencies contract. It prints the final JAR size and the +all unreachable versioned payload and preservation of every base +`org/bouncycastle/` entry from the three resolved BC libraries. It prints the final JAR size and the compressed upstream payload omitted. That payload counter is not an exact before/after distribution size: shading/recompression and ZIP overhead differ. To measure the exact reduction, compare clean baseline and candidate builds with