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
1 change: 0 additions & 1 deletion AdvancedCore/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@
<groupId>com.bencodez</groupId>
<artifactId>simpleapi</artifactId>
<version>1.0.2-SNAPSHOT</version>
<classifier>thin</classifier>
<scope>compile</scope>
<exclusions>
<exclusion>
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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"));
Expand All @@ -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));
}

Expand Down
15 changes: 9 additions & 6 deletions docs/jar-packaging.md
Original file line number Diff line number Diff line change
@@ -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 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.
Expand All @@ -15,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.
Loading