Scala 'sbt' how to add application assembly information to jar file?

I have a file called "build.sbt":

lazy val root = (project in file(".")). settings( name := "AppName", version := "1.0", ) 

I compile such a source in PowerShell:

 $process = Start-Process -FilePath (Join-Path $sbtHome "sbt.bat") -ArgumentList "assembly" -Wait -PassThru -WindowStyle Hidden 

Then I get this jar file "AppName-assembly-1.0.jar". Then right-click on it and select "Properties" and then the "Details" tab. And there I see neither the name of the application, nor the version information: enter image description here

Q: How to make Version and AppName be saved / displayed in the properties window "Details" tab, not only be reflected in the banner name?

In the example, for example, in one of the app.exe files: enter image description here

+5
source share
1 answer

If you installed it on your computer.

  • Open terminal
  • Go to the folder where build.sbt is located ( cd /path/to/)
  • sbt assemblyPackageDependency
  • sbt package

This will create a standalone jar with all the dependencies in target/scala-2.xy/project_name_2.xy-zz.jar , which should have the application name and version number.

0
source

All Articles