Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions SimpleAPI/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,6 @@
</includes>
</configuration>
</execution>
<execution>
<id>thin-library</id>
<phase>package</phase>
<goals><goal>jar</goal></goals>
<configuration>
<classifier>thin</classifier>
</configuration>
</execution>
<execution>
<id>shared-library-sources</id>
<phase>package</phase>
Expand Down Expand Up @@ -208,7 +200,6 @@
<reportsDirectory>${project.build.directory}/full-artifact-reports</reportsDirectory>
<systemPropertyVariables>
<simpleapi.fullJar>${project.build.directory}/${project.build.finalName}.jar</simpleapi.fullJar>
<simpleapi.thinJar>${project.build.directory}/${project.build.finalName}-thin.jar</simpleapi.thinJar>
</systemPropertyVariables>
</configuration>
</execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
}
}
13 changes: 2 additions & 11 deletions docs/jar-packaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
Loading