Search code examples
scalasbtsbt-assemblysbt-native-packagersbt-plugin

Create fat.jar + external file into a single tar.gz file to publish on my Nexus using Sbt-native-packager


I'm trying to create a single package which contains a fat.jar using sbt-assembly and After pack this with some external files present into my resources in a single file named .tar.gz, do you have some tips?

I tried Universal:packageZipTarball but I don't understand how specify the structure files I want to get. I have created the fat.jar yet but I'm still missing the next step.


Solution

  • The contents of the package are controlled by the mappings task.

    https://www.scala-sbt.org/sbt-native-packager/introduction.html#mappings

    You need to customize that task in order for it to generate the structure you desire. There's a section in the manual that explains how to add a fat jar to the package: https://www.scala-sbt.org/sbt-native-packager/recipes/custom.html#sbt-assembly