Add SBT uber-jar creation info
Something that some SBT users run into is uber-jars that give a Nd4jBackend.NoAvailableBackendException, due to incorrect packaging with plugins like sbt-assembly plugin (for example, missing or not adding java service loader files under /META-INF/services/
Having something we can point users to for this would be useful.
Due Date
To be completed by: YYYY-MM-DD
Description
Write a short description of what needs to be done.
Assignees
Please ensure you have assigned at least one person to this issue. Include any authors and reviewers required.
From gitter: Cause for one user was discard merge strategy removing all of the service loader files:
assemblyMergeStrategy in assembly := {
case PathList("META-INF", xs @ _*) => MergeStrategy.discard
case x => MergeStrategy.first
}
Fixed by:
assemblyMergeStrategy in assembly := {
case PathList("META-INF", "MANIFEST.MF") => MergeStrategy.discard
case x => MergeStrategy.first
}
(Note that this discards the manifest file, which is probably OK in most cases, but not all)
@AlexDBlack where are you thinking we should put this? In this page? https://deeplearning4j.org/docs/latest/deeplearning4j-config-buildtools
Thanks. The above fix worked for me. I was struggling with this for quite a while. I saw it using sbt 1.3.8, sbt-assembly 0.14.10, and nd4j 1.0.0-beta3 and 1.0.0-beta6