Closed ZhiruiLi closed 5 years ago
You need to set merge strategy for these dependencies
assembly / assemblyMergeStrategy := {
case PathList("module-info.java") => MergeStrategy.discard
case PathList("module-info.class") => MergeStrategy.discard
case "META-INF/truffle/language" => MergeStrategy.discard
case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
}
This worked for my case with java 8 and Graal 19.0.0
Thanks!
I had to change
"META-INF/truffle/language" => MergeStrategy.discard
to
"META-INF/truffle/language" => MergeStrategy.rename
I also had to create resources/META-INF/truffle/language
file containing
language1.charactermimetype.0=application/javascript
language1.charactermimetype.1=application/javascript+module
language1.charactermimetype.2=text/javascript
language1.classname=com.oracle.truffle.js.lang.javascriptlanguage
language1.defaultmimetype=application/javascript
language1.dependentlanguage.0=regex
language1.filetypedetector0=com.oracle.truffle.js.lang.jsfiletypedetector
language1.id=js
language1.implementationname=graalvm javascript
language1.interactive=true
language1.internal=false
language1.name=javascript
language1.version=inherit
language2.charactermimetype.0=application/tregex
language2.classname=com.oracle.truffle.regex.regexlanguage
language2.id=regex
language2.implementationname=
language2.interactive=false
language2.internal=true
language2.name=regex
language2.version=0.1
otherwise library couldn't find languages
You need to set merge strategy for these dependencies
assembly / assemblyMergeStrategy := { case PathList("module-info.java") => MergeStrategy.discard case PathList("module-info.class") => MergeStrategy.discard case "META-INF/truffle/language" => MergeStrategy.discard case x => val oldStrategy = (assemblyMergeStrategy in assembly).value oldStrategy(x) }
This worked for my case with java 8 and Graal 19.0.0
This does not work.
[error] 1 error was encountered during merge
[error] 1 error was encountered during merge
[error] 1 error was encountered during merge
[info] Strategy 'discard' was applied to 48 files (Run the task at debug level to see details)
[info] Strategy 'rename' was applied to 7 files (Run the task at debug level to see details)
[error] java.lang.RuntimeException: deduplicate: different file contents found in the following:
[error] /Users/dave/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.12.0/jackson-annotations-2.12.0.jar:module-info.class
[error] /Users/dave/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.12.0/jackson-core-2.12.0.jar:module-info.class
[error] /Users/dave/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.12.0/jackson-databind-2.12.0.jar:module-info.class
This does not work.
[error] /Users/dave/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.12.0/jackson-annotations-2.12.0.jar:module-info.class [error] /Users/dave/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.12.0/jackson-core-2.12.0.jar:module-info.class [error] /Users/dave/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.12.0/jackson-databind-2.12.0.jar:module-info.class
Looks like it's not related to graalvm
Hi, I trying to use graal vm in my Scala project as JS engine. This project will finally be packed as one fat jar file by sbt assembly. When I run project in IDEA, everything goes well, but when I try to pack it using sbt assembly, file duplicate exception occurs:
If the project only add dependency of
"org.graalvm.js" % "js-scriptengine" % "1.0.0-rc14"
, the error will be (ignore many output in ... ):If the project only add dependency of
the error will be (ignore many output in ... ):
Can anyone know how to solve this problem?