Questions tagged [sbt]
sbt is an open source build tool for Scala and Java projects, similar to Java's Maven or Ant.
9,623
questions
1
vote
0
answers
10
views
Include scala source files in sbt pack output jar
How can the scala source files of a project be included in the generated target jar produced by sbt pack?
Currently, when an IDE user of my jar tries to jump to a function in the library they will ...
0
votes
0
answers
22
views
+200
SBT: add command-line parsing to modify settings for existing tasks
When running tasks (e.g., test, jmh:run), I often want to specify javaOptions which are tedious to type by hand (e.g., to dump program data).
This is my current approach:
// build.sbt
lazy val ...
0
votes
1
answer
14
views
Visualizing dependency size via sbt assembly
I am using sbt assembly to package my project into one fat jar. I wanted to understand if I can visualize how much disk space is each dependency taking in my fat jar.
0
votes
0
answers
8
views
Spark in SBT console: "Could not find spark-version-info.properties"
I'm trying to instantiate a SparkContext inside a SBT console, using the following scala commands:
import org.apache.spark.SparkConf
import org.apache.spark.SparkContext
import org.apache.spark....
0
votes
0
answers
23
views
Server access Error: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException on macOS Big Sur
I am on macOS Big Sur and I am using EAA as my corporate VPN.
Whenever I run sbt I get this error stack trace.
> sbt clean compile
[info] Loading global plugins from /Users/shril/.sbt/0.13/plugins
[...
0
votes
1
answer
21
views
VS Code / Metals: How to debug Scala sbt project using remote Debugger?
I know the question has been asked before in some variation here, but I simply can not figure out how to debug my scala sbt project in VS Code (WSL). Can someone provide some detailed instruction on ...
1
vote
1
answer
22
views
spark-cassandra (java.lang.NoClassDefFoundError: org/apache/spark/sql/cassandra/package)
i am trying to read DataFrame from cassandra 4.0.3 with spark 3.2.1 using scala 2.12.5 and sbt 1.6.2 but i have a problem.
this is my sbt file:
name := "StreamHandler"
version := "1.6....
0
votes
1
answer
22
views
requirement failed: Provided Maven Coordinates must be in the form 'groupId:artifactId:version'
I get the following error
requirement failed: Provided Maven Coordinates must be in the form
'groupId:artifactId:version'
when I run the command below
spark-submit --class StreamHandler\
--master ...
1
vote
0
answers
14
views
SBT release plugin creates SNAPSHOT jar
My jenkins job run the below command , but it's generating SNAPSHOT jar only.
sbt 'set isSnapshot := false' 'set releaseIgnoreUntrackedFiles := true' 'release skip-tests with-defaults'
Here is my ...
0
votes
0
answers
21
views
Flink with SBT : Expose metrics to Prometheus
I have a Flink application written in Scala that I build with SBT. My goal is to expose Flink metrics to Prometheus. Prometheus runs in a Docker instance and my Flink application is lauched with SBT ...
0
votes
0
answers
4
views
How To Copy JAR into Dockerfile When Using SBT Native Packager
I'm using the sbt native packager for generating the Dockerfile image. However after run, I get to see this Dockerfile generated:
FROM adoptopenjdk/openjdk13:alpine-slim as stage0
LABEL snp-multi-...
1
vote
1
answer
28
views
How to push to GitHub protected branch via sbt-release plugin?
TL;DR:
What is the correct workflow to use both sot-release plugin with GitHub protected branch?
I'm using sot-release plugin in order to auto-increment the project version files, and to commit it to ...
1
vote
0
answers
12
views
SBT Create a DockerFile Using a Function
I was trying this piece of code:
// Get the Docker Configurations
def dockerConfForModule(moduleName: String): Dockerfile = {
val jarFile: File = (Compile / packageBin / sbt.Keys.`package`).value
...
0
votes
0
answers
14
views
Exclude Packages From Source Directory in SBT
I have been trying to get this to work where I would like to evict some packages being part of the finally packaged JAR.
// Filter when packaging
excludeFilter in (Compile, unmanagedSources) ~= { ...
0
votes
0
answers
8
views
Dynamically change SBT Package based on Input to SBT command
I have a project where I'm having several Object that contains the main function. I would like to package several JAR out of this project where each JAR contains only certain packages. For example., ...
0
votes
1
answer
21
views
Cannot pass arguments using sbt to gatling simulation
Regarding to Gatling SBT execute a specific simulation topic is there any way to pass argument to simulation?
I've been trying passing command from any CLI like:
sbt -Dx=1 -Dy=2 -Dz=3 "gatling:...
0
votes
0
answers
10
views
java.lang.RuntimeException: Settings logger used after project was loaded
i am using play framework 2.6 and sbt latest version
I ran sbt -jvm-debug 9000
and received this following error.
not sure how to solve this.
(any suggestions is welcomed in order to improve question)
...
0
votes
1
answer
19
views
ScalaPb sbt: Import "data/common/num.proto" was not found or had errors
My project structure is:
logs
- data
- pubs
- invent.proto
- common
- num.proto
NOTE - The .proto files are not under src/main/protobuf. They're under a directory called logs ...
0
votes
0
answers
6
views
sbt: Getting error output from an external process (yarn)
We run into a problem with 'yarn build' command run from build.sbt:
println(Process("yarn build", frontEndFile).!!)
The output is just:
[info] yarn build 3456
[error] java.lang....
0
votes
0
answers
19
views
How to run scala spark intellij-idea project in mac terminal?
I um using intellj IDE for my spark project using scala. The requirement is to run the program from the terminal by passing the csv filename to the project using terminal.
My project structure is as ...
1
vote
1
answer
41
views
It is possible to Stream data from beam (Scio) to an S3 bucket?
Currently, I'm working on a project which extracts data from a BigQuery table using Scio in Scala.
I'm able to extract and ingest the data into ElasticSearch, but I'm trying to do the same but using ...
1
vote
0
answers
11
views
Error downloading apex:apex-jorje-ide:1.0-sfdc-187-SNAPSHOT-55042bfc2e
I am using Scala 2.13.9 and SBT version 1.1.1 and I see this error when i run the sbt run command. I do not find this dependency anywhere. I have looked on MVN repositories as well but t could not ...
0
votes
0
answers
22
views
override sbt internal dependency
sbt contains internal dependency - util logging:
https://mvnrepository.com/artifact/org.scala-sbt/util-logging_2.10/1.2.0
and util logging dependency contain org.apache.logging.log4j » log4j-api:
...
0
votes
0
answers
18
views
Error occurs during SBT launcher. How to rectify the error?
SBT is installed and while checking the same in cmd prompt using command 'sbt about', getting this error.
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at sbt....
0
votes
0
answers
22
views
Which is the best way to merge a sbt project and a maven project? [closed]
Currently I have two projects on hands: Project A, a single module java project using sbt, which contains only a few controllers. Project B, a single module java project using maven, which contains ...
1
vote
0
answers
34
views
sbt run failed spark@3.2.1
I maded a simple spark app in this repository, where sbt run always report errors as
Exception in thread "Thread-2" java.lang.RuntimeException: java.nio.file.NoSuchFileException: /github.com/...
0
votes
1
answer
40
views
Play - Cannot connect to sql server with com.microsoft.sqlserver.jdbc.SQLServerDriver
I'm working on a Play 2.8.13 project with Scala 2.12, and I want to connect to my mssql database, here's what my application.conf contains:
db.default.driver=com.microsoft.sqlserver.jdbc....
1
vote
0
answers
19
views
package .proto files into a separate jar and publish it to a remote repository
I am very new to scala and hardly any experience with build.sbt. I have a scala project with .proto files inside src/main/proto directory. I need to package these proto files into a separate jar using ...
0
votes
0
answers
23
views
Scala scala.js cannot find module js script in sbt build
I'm trying to import a JS Script script.js into a scala program App.scala and use its methods add and divide.
However on running the program, I keep getting the error, Cannot find module 'resources/...
0
votes
0
answers
33
views
Refering other modules class which has other scala version
I have 2 modules. API and Calculator
API is depend on scala version 2.12.8 and calculator depend on scala version 2.13.8
API is using one of the class in Calculator. This is my build.sbt
name := "...
0
votes
1
answer
22
views
Scala Scala.js importing JavaScript module gives 'There were linking errors, module support is disabled'
I'm trying to import a JavaScript class module script.js into a scala program main.scala and use its methods add and divide.
I'm using scala.js for importing the JS script and SBT for build.
However ...
0
votes
1
answer
20
views
Scala Scala.js importing JavaScript module gives error 'method value is not a member of'
I'm trying to import a JavaScript class module script.js into a scala program main.scala and use its methods add and divide.
I'm using scala.js for importing the JS script and SBT for build.
However ...
0
votes
0
answers
25
views
How do I handle MANIFEST.MF with sbt and Intellij?
I'm writing an application in Scala using IntelliJ and sbt (latest stable version on everything).
I can run and debug it just fine from within intellij but if I try to run the standalone artifact it ...
0
votes
0
answers
21
views
SBT gives my Scala program stale resource files
I have a simple Scala project using SBT. I have a resource file, src/main/resources/cea-builtins.rkt. I open it with val resource = Source.fromResource("cea-builtins.rkt").
Unfortunately, ...
0
votes
0
answers
8
views
What are the sbt commands to integrate with sonarqube?
I want to check the code of sbt using sonarqube, can anyone assist me in that.
1
vote
0
answers
56
views
How can I build a fat jar to build my Chisel code with sbt-assembly?
I would like to build a fat JAR that can build my Chisel code. I have built these previously using Maven assembly:
https://github.com/hutch31/ChiselCodeGenerator
But I would like to get this working ...
1
vote
1
answer
25
views
SBT make one project compile with only one version of scala
In sbt with a multiproject setup, is there a way to make sure that one of the projects compiles with only version of Scala. Eg
/foo (scala-2.13.8)
/bar (scala-2.12.15, scala-2.13.8, scala-3.1.1)
/baz (...
0
votes
4
answers
236
views
sbt won't install correctly; homebrew changing java versions
I just did a clean install. jdk 8 (from adoptium.net) and sbt (using homebrew) on a newly imaged macbook. Somehow homebrew used java 18 anyway, and sbt doesn't work.
I followed the instructions here:...
0
votes
0
answers
14
views
How to set local variables in build.sbt when CICD pipeline variables fail
In our build.sbt file we have a number of ENV variables where the credentials necessary for authentication through the CICD settings.
However, on a purely local build, these ENV variables are blank ...
0
votes
1
answer
10
views
issue with resolving sbt dependencies scalameta
I have created an sbt project. I am trying to add the org.scalameta dependency for scala code formatting. I added following dependency in project/plugins.sbt
addSbtPlugin("org.scalameta" %% &...
0
votes
0
answers
11
views
Bad symbolic reference error when creating sbt plugin targeting only scala3 version
I'm creating sbt plugin which is targeting for only scala 3 version.
Below is the build.sbt
ThisBuild / version := "0.1.0-SNAPSHOT"
lazy val root = (project in file("."))
....
1
vote
0
answers
30
views
Use SBT 1.3.x with Scala 2.13.8
After upgrading the Scala version to 2.13.8 (from 2.13.3) of my Scala project, the following error gets at load time:
[error] java.lang.NoSuchMethodError: 'sbt.internal.util.Init$Initialize sbt.Def$....
2
votes
0
answers
30
views
Nexus unauthorized access using sbt
I am trying to build a sbt Scala application on AWS CodeBuild. I need to use the corporate Nexus in order to download packages. However, I keep getting unauthorised access. What am I setting up wrong?
...
-1
votes
0
answers
30
views
not found: object chisel3
How could I debug this error?
This is simple code
package ch
import chisel3._
object HelloScala extends App{
println("Hello Chisel World!")
}
If excuting sbt run
"not found: object ...
0
votes
0
answers
4
views
Laziness of parsers of inputTasks
I've realized that all completions of parsers in inputTasks are calculated when SBT is loading.
Some of them are a little slow.
Why isn't this done lazily? It would improve the SBT load speed.
Many ...
0
votes
0
answers
7
views
SBT local-preloaded missing in 1.6.1
I'm new to sbt. I'm trying to upgrade the sbt version from 0.13.18 to 1.6.1.
I found there was a local-preloaded directory in 0.13.18 release tarball. We are using it to provide the ivy cache. But ...
3
votes
2
answers
1k
views
sbt assembly cannot create jar getting java.lang.UnsupportedOperationException
I am using
scala 1.12.10
akka 2.6.3
addSbtPlugin("io.spray" % "sbt-revolver" % "0.9.1")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.1.0&...
0
votes
0
answers
59
views
Error: Class path contains multiple SLF4J bindings
While this does seem to be a common issue, I have looked and tried many fixes for sbt and this dependency issue without success.
Setup is a simple query to hive from scala using the run command within ...
0
votes
0
answers
16
views
scalac Scapegoat plugin for latest scala version
In my current sbt project I'm using scala version (from build.sbt scalaVersion) is 2.11.12. I want to upgrade this scala version to latest (3.1.1). In project sbt-spacegoat version is 1.0.7 When doing ...
0
votes
1
answer
31
views
sbt-avro is not generating Scala classes, possible settings issue
I'm trying to use sbt-avro in a Scala project to generate Scala classes from an Avro schema.
Here is the project structure:
multi-tenant/
build.sbt
project/
plugins.sbt
src/
...