10,002 questions
1
vote
0
answers
77
views
Can an SBT setting (logLevel) be set only if another setting (insideCI) is true?
I'm working with an SBT build that has reduced some of its logging, since it's generating overly large build output in our CI environment:
ThisBuild / logLevel := sbt.Level.Warn
Ideally, I would like ...
Advice
1
vote
4
replies
68
views
Attempting to add a module-info.java to spark.core.2.13 of Apache Spark: how to make scala accepting module delaration and gather its classes?
I'm willing to progress into the subject of introducing java modules into Apache Spark. They are needed for:
sorting and avoiding conflicts between dependencies.
allow Spark modules to be integrated ...
4
votes
0
answers
124
views
sbt-jacoco counting synthetic methods
I saw one problem during project upgrade.
Before upgrade setup:
Java - 1.8
Scala - 2.12
sbt - 1.5.0
sbt-jacoco - 3.1.0
Overall test coverage in SonarQube: ~72%
After upgrade:
Java - 17
Scala - ...
1
vote
1
answer
79
views
Setting logLevel throws an exception
I attempted to start sbt with sbt -Dpact.logLevel=DEBUG and it threw a class-cast exception.
[error] (pactVerify) java.lang.ClassCastException: class org.apache.logging.slf4j.Log4jLogger cannot be ...
1
vote
0
answers
96
views
How to run sbt offline (downloading all the dependecies and moving)
I wanted to use riscv-torture project to create tests in a server that has no access to the internet. I firstly run it in my ubuntu 22.04 then copy .sbt .ivy2 .cache/coursier .cache/JPN folders to the ...
1
vote
0
answers
56
views
Get list of settings from another setting in SBT
I'm new to Scala and I'm having trouble wrapping my head around the following scenario - I want to have a centralized spot in build.sbt where we log the current profile and set certain values based on ...
0
votes
0
answers
27
views
How can I get a finally to work in sbt scripted plugin
I am writing some sbt code that adds files dynamically upon calling scripted. However, I need to clean up those files after it completes so that they are not checked into source by accident. The add ...
0
votes
0
answers
37
views
Play Framework 2.9 upgrade: getMinKeyLength method not found due to io.jsonwebtoken version conflict
I am upgrading my Play Framework project from version 2.8 to 2.9. As part of this, I upgraded my Java version to OpenJDK 17 and updated my build.sbt and plugins.sbt files accordingly.
The project ...
0
votes
1
answer
107
views
Migration to playframework 3.0 - Error while emitting Routes.scala
I try to migrate old playframework 2.8 to 3.0.8 (jdk 11 -> jdk 21).
And when try to compile: ./sbt clean compile see this error:
[error] Error while emitting Routes.scala
[error] assertion failed: ...
0
votes
2
answers
52
views
sbt sonaUpload does not use ArtifactID in deployment name
When uploading a release to Sonatype using sbt sonaUpload, the deployment that is created only includes the groupid/namespace and the version, but not the artifact ID.
As a result, the list of ...
0
votes
2
answers
120
views
sbt plugin resolvers not adding sbtVersion, scalaVersion to artifactory url
In an sbt project, I'm adding some plugins, like
addSbtPlugin("org.typelevel" % "sbt-tpolecat" % "0.5.2")
This should resolve to an artifact url similar to this:
https://...
0
votes
1
answer
99
views
Referring to non-existent class while compiling to ScalaJS
I'm builing a ScalaJs & Scala3 application, when i run the npm run dev/build command I have the following error, and I'm not figuring out how to fix it:
Referring to non-existent class scala....
1
vote
1
answer
64
views
Does `sbt compile` install things out of the current project directory?
I am a noob in scala. I installed it using coursier and am using sbt to try and write code in it. Basically, I use the two commands sbt compile and sbt run for my code. Along, with that I was ...
0
votes
0
answers
49
views
How can I get SBT to render the character `─ ` in the prompt?
I'm trying to configure my SBT prompt to end with the characters └─→ in the terminal. I've overridden the shell prompt with the following code in ~/.sbt/1.0/global.sbt
shellPrompt := { state =>
&...
0
votes
2
answers
123
views
Spark (on Scala) replace gson version in Runtime
My sbt project has the following dependency configuration:
val scyllaConnector = "com.datastax.spark" %% "spark-cassandra-connector" % "3.2.0"
val sparkHadoopCloud = &...
0
votes
1
answer
99
views
SBT Java The system cannot find the path specified
I am getting the below error, tried various versions of java still I am getting the error
$ ./sbt compile
java.io.IOException: The system cannot find the path specified
at java.io.WinNTFileSystem....
1
vote
1
answer
406
views
Fix missing transnitive dependencies with jlink and scala3 `scala.quoted -> scala `
I'm trying to upgrade a scala library to scala3 and cannot seem to figure out how to get the scala3 language to work with jlink. It says I'm missing transitive dependencies on a jlink build. You can ...
0
votes
1
answer
152
views
@nowarn is not working in Scala. Intellij Idea
I'm new to Scala and the @nowarn system seems a little bit confusing.
I've tryed to remove lint errors on Function1 and Function2 with nowarn, but it didn't work.
So, here's this programm:
import ...
1
vote
0
answers
92
views
investigating java.lang.OutOfMemoryError: unable to create native thread in an SBT build in Docker
One of our teams using SBT is moving to run their build in a self hosted Github runner, and it's now failing while running the tests with this error :
[106.424s][warning][os,thread] Failed to start ...
1
vote
0
answers
84
views
Scala: typesafe config issue
With scala version 2.13.16 and "com.typesafe" "config" version "1.4.3"
I'm trying to configure application with following application.conf file:
performances = {
...
1
vote
0
answers
69
views
Scala sbt operation: Duplicate slf4j error
Project is configured in build.sbt file:
ThisBuild / version := "0.1.0-SNAPSHOT"
ThisBuild / scalaVersion := "2.13.16"
lazy val root = (project in file("."))
.settings(
...
1
vote
0
answers
33
views
Marking direct dependency as runtime and excluding transitive dependencies in test
(avro % Runtime).excludeAll(
ExclusionRule(organization = "com.fasterxml.jackson.core"),
ExclusionRule(organization = "org.apache.commons"),
ExclusionRule(...
1
vote
3
answers
125
views
Add sources for unmanaged JARs in SBT
I'm setting up a build.sbt where I need to have a bunch of managed JARs on the classpath. I basically have two large folders containing all of the JARs and then also the source JARs.
myManagedRoot
|- ...
2
votes
0
answers
74
views
Can I declare a Scala library as 'always shade'?
I have a Scala library, lets call it extensions, with extension methods declared in package extensions. It is evolving relatively quickly; lets say that version 1.1 adds new extension methods to 1.0, ...
0
votes
0
answers
88
views
sbt.librarymanagement.ResolveException: Error downloading org.http4s
I tried to build project with http4s dependencies for Scala versions 2.13.0 and 2.13.16
with combinations of JDK 8 and 11
Versions are:
val http4sVersion = "1.0.0-M44"
libraryDependencies ++...
0
votes
0
answers
57
views
sbt envVars not propagated to sub-projects
I've had this issue in a project of mine and I've setup a minimal example reproducing the issue, it took me a while to figure out the problem.
But it seems that when I set Test / envVars in my build....
0
votes
0
answers
106
views
Play Framework 3.0.5 and jackson-databind version 2.17.0
I have a Play Framework 3.0.5 project on which I needed to update a module which has a requirement for jackson-databind version 2.17.0.
Since get the following error, and don't seem to be able to find ...
0
votes
1
answer
66
views
Scala/Play cant find custom library
I am a Scala beginner, having some initial issues with classpaths which I think may stem from sbt.
play.api.PlayException: Execution exception[[InjectionException: Injection error, interface my....
0
votes
1
answer
182
views
How to run CLI commands using build.sbt?
I want to define a CLI command in build.sbt and want it to be executed when I run the sbt command from the shell script.
For example: I have already included sbt-bloop plugin in my scala-sbt project.
...
0
votes
1
answer
89
views
Sbt FlywayMigrate Command Hanging after Upgrading Flyway Sbt
After upgrading flyway-sbt from 7.4.0 to 9.22.0 the sbt flywayMigrate command now hangs, e.g. | => root / flywayMigrate {x}s . In our migration scripts, we are creating the indexes concurrently.
...
1
vote
0
answers
88
views
SAXParseException Being Thrown When Attempting to Upgrade From Scala 2.12.20 to 2.13.0
We're attempting to upgrade our Scala app from 2.12.20 to 2.13.0 but as soon as we do, we get the following error when trying to compile:
[error] (update) org.xml.sax.SAXParseException; lineNumber: 1; ...
0
votes
1
answer
123
views
trying to build a job on jenkins where i use fluway-sbt plugin
I am building a certain job which is using flyway-sbt. the weird thing that the job is running locally but failed in jenkins and the error message is:
[warn] Note: Some unresolved dependencies have ...
0
votes
1
answer
54
views
GuiceApplicationBuilder and PlayTest tests erroring with play/Configuration not found on run path
We have our Playframework tests setup with fakeApplication using GuiceApplicationBuilder
class BaseSpec extends AnyFunSpec/PlaySpec with GuiceOneAppPerSuite {
override def fakeApplication(): ...
0
votes
0
answers
73
views
Remove scala-library.jar from Scala 3 project
I am trying to replicate one Java project in Scala and SBT. For some reason, copying Runtime / managedClasspath into target/libs folder also copies scala-library-2.13.15.jar beside scala3-library_3-3....
0
votes
1
answer
65
views
Protocol exception in sbt:publishSigned
I want to publish a new version of my functional logger in Scala ("Flog").
The changes to the code are relatively minor.
I've upgraded some dependencies, including to Scala 2.13.16.
I haven'...
1
vote
1
answer
88
views
401 while dowloading Scala package published publicly on Github from a public repo
I published a Scala package on a public Github repo. The package visibility is also public, but a token was used to publish it which I provided inside the build.sbt as it's the required standard.
When ...
2
votes
1
answer
115
views
How do I replace/override a dependency of a sbt plugin with a completely different artifact?
In my project/plugins.sbt file, I add a plugin that pulls in a dependency that has a vulnerability. The fix is another artifact that has a completely different group ID. How do I replace the first ...
1
vote
1
answer
71
views
sbt-crossproject publishes jvm project with unexpected name
I'm trying to publish few scalamock modules for jvm and js simultaniously.
I'm using sbt-crosspublish and sbt-ci-release.
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1....
2
votes
0
answers
58
views
How to use Isabelle scalac wrapper in build.sbt
I have a Scala development environment with Metals and a build.sbt. The theorem-prover Isabelle provides its own wrappers for Scala tools such as scalac, scala, etc. I have Isabelle added to my path ...
1
vote
2
answers
383
views
RRunning tests with Spark 3.5.1 on Java 17 fails with IllegalAccessError: class StorageUtils cannot access class sun.nio.ch.DirectBuffer
I am using scala 2.12.12, sbt 1.6.0, spark 3.5.1 with java 17 to run spark jobs. It appears my tests are failing due to sun.nio.ch. I researched and it seems to be a problem with java 17 version, how ...
0
votes
1
answer
207
views
GitHub Actions Not Resolving GitHub Packages via Sbt Plugin
I have a project where I build a sbt settings plugin that I intend to use across all my other projects. In this sbt plugin project, I define several common settings like resolvers, scm info, other ...
0
votes
1
answer
175
views
Repeated Setting of Scalac Flags in Scala 3
I'm having this build.sbt for one of my projects and this project uses an sbt plugin that I have internally built and published locally. This sbt plugin contains the common shared settings and looks ...
0
votes
1
answer
233
views
Conflicting Cross Version Suffixes Error in Scala Dependencies
In my project, I'm running into conflicting version suffixes error for cats libraries. I ran sbt evicted, but I could not fully make sense of how to interpret it to resolve this error. Here is the ...
1
vote
1
answer
167
views
Ignoring certain Scala 2.13 compiler options for build to succeed
I have a Scala sbt project where I'm using the sbt-tpolecat plugin:
// scalac options for the enlightened @see https://github.com/typelevel/sbt-tpolecat
addSbtPlugin("org.typelevel" % "...
0
votes
0
answers
59
views
Sbt Plugin Error When Cross Compiling Scala Versions
I#m trying to implement an sbt plugin that contains some common settings that I can publish and add as a sbt plug in my other projects.
I have the project structure like this:
my-plugin-project
- ...
1
vote
1
answer
458
views
Sbt Compiler Bridge Error With Cross Scala Versions
I have a sbt project using sbt version 1.10.6 where I have set it to cross compile to 2.13.x and 3.1.x scala versions.
lazy val scala313 = "3.1.3"
lazy val scala2138 = "2.13.8"
...
1
vote
0
answers
53
views
sbt dependencyTree shows unexpected test dependency
sbt dependencyTree unexpectedly includes projects that are depended on with scope Test, which should not happen.
Starting with a barebones project like this:
name := "root"
ThisBuild / ...
1
vote
1
answer
81
views
sbt libraryDependencies error: ')' expected but string literal found
I'm new to sbt and Scala. I'm following the Getting Started guide:
Open up build.sbt and add the following line:
libraryDependencies += "org.scala-lang.modules" %% "scala-parser-...
2
votes
1
answer
96
views
What are the available sbt new templates?
The Getting Started guide for Scala says:
Run the command sbt new scala/scala3.g8 to create a Scala 3 project, or sbt new scala/hello-world.g8 to create a Scala 2 project.
Are there any more sbt new ...
4
votes
0
answers
82
views
managedSourceDirectories compilation order in a Scala/Java project when upgrading to Scala 3
We've recently upgraded to Play Version 3.0.5, running Java 21.0.4, sbt version 1.10.3, with scalaVersion 2.13.14. Everything compiles and runs correctly with these versions when running sbt clean ...