In short: My sbt universal:packageBin also packs up all platform dependent jars instead of the few Im interested in and on SBT I cant exclude them.
I also followed the hint to NOT depend on “nd4j-native-platform-1.0.0-M2”, but e.g “nd4j-native-1.0.0-M1-linux-x86_64” … but that saves only the nd4j-native jars. The other ones: javacpp-platform , hdf5-platform , openblas-platform , opencv-platform I still get pulled in in all variants through transitive dependencies that I dont control.
I can re-post the full stackoverflow issue here, if thats preferred.
Just for my understanding - from pure (SBT) dependency management perspective there is no way to exclude them? (So basically SBT is not to blame)
The way the artifacts are declared, they will pull in all those platforms and the only way to control this is not via common dependency management declarations, but the specific (maven-first) tool that all those “org.bytedeco.*” libraries share ?
PS: just for the dimensions: a sibling module (same PlayFramework base, actually more business logic inside) has ~ 150 MB of gziped fatjar size. This one with the deeplearning4j dependency and a more narrow functional scope comes in at 1.2 GB gziped. The immediate problem is actually that is breaks the build pipeline now because of memory constrains.
I think I solved it for my specific case. I could not get the “SBT-JavaCV” plugin to work. In short, I managed via plain SBT and excluded first all "org.bytedeco.xyz-platform " dependencies from my direct dependency “org.deeplearning4j.deeplearning4j-nlp:1.0.0-M2” and in a second step added explicitly the platform specific variants back that I need (via “classifier”).