Maven dependencies
Explicit library approval, exact versions and SHA-256 verification.
Source directive
@dependency("com.google.code.gson:gson:2.10.1")
String json = new com.google.gson.Gson().toJson(List.of(1, 2, 3));
Put the directive on its own line near the start of a block or module. Use fully qualified type names because the source remains a Java method body.
Administrator approval
Downloads are disabled by default. In plugins/SkJvm/config.yml, enable dependencies.enabled and provide these fields for every artifact:
| Field | Value |
|---|---|
coordinate |
Exact group:artifact:version |
sha256 |
Verified JAR SHA-256, 64 hexadecimal characters |
packages |
Approved package prefixes, such as com.google.gson |
dependencies:
enabled: true
allowed:
- coordinate: "com.google.code.gson:gson:2.10.1"
# Replace this placeholder with the verified JAR hash.
sha256: "REPLACE_WITH_VERIFIED_64_CHARACTER_SHA256"
packages: ["com.google.gson"]
The placeholder is not a working hash and will fail configuration validation. Restart the server after policy changes.
Downloads and caching
Only Maven Central is used; arbitrary repositories and implicit POM execution are not supported. JARs are limited to 32 MiB and verified before class loading. Approved artifacts are cached by SHA-256 under plugins/SkJvm/libraries.
Transitive dependencies are not resolved automatically: declare and approve each required JAR separately. Downloads run in the compiler pool.