Search code examples
scalazipsbtnexussbt-native-packager

How to include version with sbt-native-packager publish?


I'm currently using sbt publish to publish the jar etc to a Nexus repo but I also want to include the zip. I've tried using sbt universal:publish from the sbt-native-packager and this is creating the zip and tgz that I want but is putting them in a different place to the output from sbt publish

The sbt publish command places the files in a PROJECT-NAME_2.11/PROJECT-NAME_2.11-999-SNAPSHOT.jar whereas sbt universal:publish puts them in PROJECT-NAME/PROJECT-NAME_2.11-999-SNAPSHOT.zip. There is no scala version which means they sit in different directories.

How can I get these two commands to create their respective file in the same directory? Or is there another command I can use to get the behaviour I want?


Solution

  • You could remove the scala version when you use sbt publish defining:

    crossPaths := false
    

    You can find more configuration examples in this link.