Questions tagged [sbt-native-packager]
The sbt Native Packager is designed to package software built with the sbt build system into native packaging systems such as msi, deb, rpm, etc.
345
questions
0
votes
0
answers
105
views
Building a native image on Mac ARM64 for linux/amd64 in sbt
I'm using the sbt-native-packager plugin in sbt to generate a linux executable to be wrapped inside an alpine docker image.
Since I've switches to the new Mac arch (ARM64) this doesn't work anymore.
...
1
vote
1
answer
30
views
Which namespace is correct, "com.typesafe.sbt" or "com.github.sbt"?
www.scala-sbt.org uses the "com.typesafe.sbt" namespace for sbt-native-packager, sbt-native-packager.readthedocs.io uses the "com.github.sbt" namespace. Both sites appear to be ...
1
vote
0
answers
83
views
Add file to classpath of testcontainer in VS Code / Metals using build.sbt
I have an sbt project configured with a build.sbt. When I run tests, a docker container is started with a configuration file available. This is how I wanted to use it in the test (https://www....
0
votes
0
answers
23
views
SBT Native Packager change output location of ZIP
This is my build.sbt:
name := "DB-Services"
version := "0.1"
scalaVersion := "2.12.12"
lazy val root = (project in file(".")).enablePlugins(UniversalPlugin,...
1
vote
1
answer
427
views
sbt-assembly - can not find main class in jar
I have a project where I am trying to create a fat jar using the sbt-assembly plugin. When I attempt to run my main class from the jar using the java -jar command, I get the error message: Error: ...
6
votes
0
answers
42
views
How to re-use an existing task in sbt but with different settings
One of the use cases I have where I want to re-use an existing task is:
Publishing a locally built docker image to a custom registry.
It would be nice if I can just re-use: Docker / publishLocal but ...
1
vote
1
answer
271
views
sbt / native-packager, new jdeps error: java.lang.module.FindException: Module java.activation not found, required by java.xml.bind
I have not changed my setup as far as I can see. As of today, trying to run sbt native packager with jlink gives this error:
[info] Running: jdeps --multi-release 11 -R ...
[error] Exception in thread ...
2
votes
0
answers
62
views
Cannot get past "paranamer" error with JlinkPlugin in sbt-native-packager
We're trying to include a minimal JDK as part of a Windows installer for a Play 2.8.8 application, using the version of sbt-native-packager included with Play.
Alas, when packaging the application, we ...
2
votes
1
answer
227
views
Play framework sbt docker:publishLocal showing Errors
I created a new project from play template https://www.playframework.com/documentation/2.8.x/NewApplication
But when i run sbt docker:publishLocal i get the below errors . However the images are ...
5
votes
2
answers
296
views
Sbt-native-packager cannot connect to Docker daemon
Here is my configuration which worked for more than one year but suddenly stopped working.
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
stage: deploy
image: "...
0
votes
1
answer
79
views
How to publish Test Only Objects in a sbt project
I have been developing a common library for my team, where I need to provide mock data for end users to write unit-test code. Ideally, the mock object should only be available to tests of packages ...
0
votes
1
answer
478
views
How to use sbt-native-packager plug-in v1.9.2 and fix "not found" error?
I'm trying to use the latest version of sbt-native-packager (v1.9.2) in a Play Framework project:
https://github.com/sbt/sbt-native-packager/tree/v1.9.2
Hence, I have added this to the project/plugins....
0
votes
0
answers
34
views
Use SBT to download / use file from URL
My goal is simple: download an external file at build-time and include it in an SBT-packaged artifact.
I have been looking or a way to fetch data based on a URL and use the local File as the source in ...
0
votes
1
answer
56
views
native-package-manager and sbt-git plugins not found on maven repo
I believe that the two plugins are not available anymore on maven central repository. I am not able to add them to the project. Everytime I get the error about unknown artifact. This has stopped ...
0
votes
0
answers
33
views
How to update latest image only during publishLocal
I would like to be able to update the latest tag when building/publishing the image locally, but not when publishing it publicly.
I added this setting:
Docker / publishLocal / dockerUpdateLatest := ...
1
vote
1
answer
94
views
Clarification on scope delegation of dockerExposedPorts with sbt-native-packager
I am using the sbt-native-packager plugin that comes with Scala Play:
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.8")
I would like to know why the ...
1
vote
0
answers
48
views
SBT shell project in terminal gives error
i am a beginner at scala programming language. i read sbt documentation and implement these in sbt shell but it gives error. how to resolve it?
....................
ThisBuild / scalaVersion := "2....
1
vote
0
answers
37
views
getting fileNotFoundException when running code on docker container using sbt native-packager
i am creating a docker image of my akka http project using sbt native-packager
here is my build.sbt file
name := "myproject-auth"
version := "0.0.1"
enablePlugins(DockerPlugin)
...
0
votes
1
answer
82
views
Why is the scala-compiler.jar included as library in my artefact
When I build an artefact with
sbt universal:packageZipTarball
the scala-compiler.jar is included as a lib in my artefact.
Why is the scala-compiler needed at runtime? In my understanding it shouldn't ...
0
votes
1
answer
346
views
Conditional JavaAgent Command for SBT Native Packager
I'm using scala, sbt, sbt-native-package, and potentially sbt-java-agent to conditionally activate a datadog java agent at runtime w/ kubernetes.
By adding the dd-java-agent as a dependency and adding ...
1
vote
2
answers
843
views
Docker tag with date no longer functions in Gitlab
Previously, I've managed to tag my latest images and push them to Gitlab container registry without any problem for months. However, I've noticed ever since yesterday that Gitlab no longer managed to ...
1
vote
1
answer
204
views
NoClassDefFoundError during runtime on application built with sbt
I have the following build.sbt file:
lazy val shared = (project in file("shared")) .
settings (moduleName := "x-shared") .
...
lazy val service = (project in file ("...
2
votes
1
answer
140
views
Multiple jars for multiple test packages in sbt
Is there any way in sbt (custom task or plugin) to pack packages in separate jars.
For example :-
In this sample project, there should be 6 jar files generated for packages eg1, eg2, eg3, eg4, eg49, ...
2
votes
1
answer
467
views
How to set the Docker Registry with sbt-native-packager
I'm trying to build a Docker image using sbt-native-packager with the following build.sbt (trying to publish the image to a local repository)
val sparkVersion = "2.4.5"
scalaVersion in ...
0
votes
1
answer
151
views
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 ...
0
votes
1
answer
227
views
'Action not found' from production version of Play App
I'm trying to dockerize Play 2.8 Scala App. I followed instructions from documentation (https://www.playframework.com/documentation/2.8.x/Deploying) and generated target (sbt clean & sbt dist). ...
1
vote
0
answers
114
views
How to do multiple docker builds on single sbt project?
I want to have a JDK8 and JDK13 docker build using sbt. I know that I can use the dockerBaseImage settings to specify a JDK8 base image using the sbt-native-packager plugin. How can I have two ...
-1
votes
2
answers
140
views
Created scala docker image using sbt native plugin. I have to add LDAP CA cert. How to add that in the image
Scala docker plug in creates the docket image but how to add LDAP CA certificate in the image. Is there any property to set the LDAP certificate. My application requires ldap authentication during ...
1
vote
1
answer
428
views
Sbt generated docker container fails to package subproject
I have a multi-project build.sbt file, with projects like so:
lazy val utils = (project in file("utils"))
.settings(
Seq(
publishArtifact := false
)).[...]
lazy val api = (project in ...
0
votes
1
answer
249
views
using docker plugin with sbt
I am using sbt 1,3.6, jdk 11.0.6 & scala 2.13.1.
I am trying to use the sbt native packager with the docker plugin:
enablePlugins(DockerPlugin)
However, when I run sbt clean, I get the ...
2
votes
1
answer
435
views
Sbt / javaAgents / force jar-with-dependencies
I want to add "org.kohsuke" % "file-leak-detector" % "1.13" java agent to my sbt configuration.
//plugins.sbt
addSbtPlugin("com.lightbend.sbt" % "sbt-javaagent" % "0.1.5")
//build.sbt
...
0
votes
1
answer
54
views
Using stb-native-packager with Debian and SystemV on Play 2.6
I have upgrade from Play! 2.6 two Play! 2,6, but now I cannot get my application deployed.
I used to have
import com.typesafe.sbt.packager.archetypes.ServerLoader.SystemV
serverLoading in Debian := ...
4
votes
2
answers
7k
views
pass external config file to docker container at runtime
I have a scala sbt application and have a default application.conf.
I built a docker image to run this application via docker.
How can I replace the default application.conf in the docker container at ...
1
vote
1
answer
174
views
Play / Scala / sbt: docker:publichLocal with specific .conf file
I try in vain to deploy and run my play app from sbt-native-packager with the command "sbt docker:publishLocal" with a specific .conf-file on Docker.
The command as such works, the image is created, ...
2
votes
0
answers
52
views
How publish signed artifacts using universal:publish in SBT Native Packager
We are currently deploying to maven central at oss.sonatype.org. They require signing published artifacts. For our normal artifacts we are using sbt-gpg to sign and publish.
We use sbt-native-...
5
votes
2
answers
2k
views
Using a specific docker version in github actions
I want to use github actions to test the sbt-native-packager docker integration, which builds docker images from Dockerfiles.
The issue is that github actions seems to use an either old or custom ...
2
votes
1
answer
279
views
Using sbt-native-packager to instrument prometheus exporter via JavaServerAppPackaging
I am trying to instrument a java app with prometheus exporter using sbt-native-packager:
This is what I have:
plugin.sbt
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.5.1")
build....
0
votes
0
answers
573
views
SBT PublishLocal: How to set project version to the published jar and pom insted Scala version
How to set project version to the pom and jar's on SBT PublishLocal or publish
Here is my build.sbt
name := "prysm-solution"
version in ThisBuild := "2.0.1.44"
lazy val common_settings = Defaults....
0
votes
0
answers
67
views
sbt-native-packager Unknown artifact in Inellij
I am new to scala and I am trying to deploy a test application to another machine. To do this, I need all the dependancies to come with the deployment. In my search for methods to accomplish this I ...
7
votes
1
answer
281
views
Create assembly jar that contains all tests in SBT project+subprojects
I have an interesting problem where I basically need to create a .jar (plus all of the classpath dependencies) that contains all of the tests of an SBT project (plus any of its subprojects). The idea ...
2
votes
1
answer
360
views
How to make a binary file executable in Docker with sbt-native-packager?
I need to package a Scala app that handles REST API call and in some cases launches FireFox browser with help of Selenium WebDriver. I use sbt-native-packager, since it's convenient and simple. As a ...
4
votes
1
answer
649
views
Scala, docker - how to set mainClass in multimodule application using sbt-native-packager?
I have created a multimodule, sbt project in Scala. For now it is:
main project (main-service) with build.sbt file
http module with Main class
In my sbt file I have:
lazy val root = (project in ...
0
votes
1
answer
112
views
how to run scala sbt-native-packager for a appJS/appJVM cross-build project
The sbt-native-packager can make a zip file with all dependencies and a script to run_
$ sbt universal:packageBin
I have a scala web application, using cross-build (appJS for front-end and appJVM ...
3
votes
0
answers
253
views
sbt-native-packager: How can I split a fat jar into dependencies and code for Docker Layer Optimization?
Is there a way in sbt-native-packager to split a fat jar into multiple jars? Ideally one for the dependencies, another for assets, and a third for the code? I am trying to optimize docker layering by ...
0
votes
1
answer
45
views
MSI License file for Play Application
I have a Play application that I am attempting to create an MSI for.
The documentation reads that I can set the license text for the installer dialog like this;
An (optional) rtf file to display as ...
0
votes
1
answer
111
views
Sbt-native-packager produces two different packages on two different machines
I'm building a debian package from scala project using the sbt-native-packager plugin. The package produced locally (macos) from command line has different size and of course md5sum than the one I ...
0
votes
1
answer
1k
views
How to create a Docker image of a Scala Play application using jre-alpine base image
I'd like to take advantage of the jre-alpine Docker base image to shrink down the size of the docker image that I have to push to my Docker registry, but I constantly hit this error:
[info] Step 10/...
1
vote
1
answer
128
views
sbt-assembly behaviour with jars and Spark
I have doubt about the behaviour of sbt assembly:
When I use this configuration:
assemblyMergeStrategy in assembly := {
case PathList("org", "aopalliance", xs@_*) => MergeStrategy.last
case ...
2
votes
1
answer
1k
views
How to attach a PostgreSQL volume to a Docker image generated with SBT native packager?
I would like to be able to deploy my app in a pre-prod environment for integration testing using a Docker volume that will expose an instance of PostgreSQL. I'm using Scala v2.12.8 and Play v2.7.
...
-2
votes
1
answer
780
views
How to get git.gitTagToVersionNumber value?
I am using https://github.com/sbt/sbt-git and https://sbt-native-packager.readthedocs.io/en/stable/index.html and would like to assign the value of git.gitTagToVersionNumber to my docker container.
...