Skip to content

Commit 9ed310c

Browse files
authored
fix: add Multi-Release manifest attribute to shaded JARs for GraalVM/Truffle support (#3487)
GraalVM/Truffle JARs are transitively included in protocol module shaded JARs (e.g. gremlin via arcadedb-integration -> arcadedb-engine -> GraalVM). The maven-shade-plugin strips the Multi-Release: true manifest attribute, causing Truffle's CheckMultiReleaseSupport check to use the base class (returns false) instead of the Java-9+ versioned class (returns true). Since shaded JARs sort alphabetically before the individual truffle-api and polyglot JARs, the JVM always loaded the broken version first, resulting in Engine$ImplHolder initialization failure. Fix: add ManifestResourceTransformer with Multi-Release: true to the parent pom shade plugin configuration, as recommended by the GraalVM documentation for Uber/shaded JAR setups.
1 parent d14e063 commit 9ed310c

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

pom.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,15 @@
396396
implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
397397
<addHeader>false</addHeader>
398398
</transformer>
399+
<transformer
400+
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
401+
<manifestEntries>
402+
<!-- Required for GraalVM/Truffle to initialize correctly when bundled in shaded JARs.
403+
Without this, Truffle's CheckMultiReleaseSupport returns false (base class),
404+
causing Engine$ImplHolder initialization failure. -->
405+
<Multi-Release>true</Multi-Release>
406+
</manifestEntries>
407+
</transformer>
399408
</transformers>
400409
<filters>
401410
<filter>

0 commit comments

Comments
 (0)