Questions tagged [sbt]

1

votes
2

answer
686

Views

Packaging src/test into a jar in a sbt project

In a sbt project, The standard source locations for testing are: Scala sources in src/test/scala/ Java sources in src/test/java/ Those test files are not packaged when I run sbt package I want to copy the packaged jar to a remote machine to run the test. Is there a way to let sbt include test resour...
Yifei
1

votes
1

answer
2k

Views

SBT/Scala: macro implementation not found

I tried my hand on macros, and I keep running into the error macro implementation not found: W [error] (the most common reason for that is that you cannot use macro implementations in the same compilation run that defines them) I believe I've set up a two pass compilation with the macro implementati...
Wonko
1

votes
1

answer
592

Views

Can we define nested projects in a SBT project?

We can define multi projects in a SBT project, like: lazy val core = project in file("core") lazy val web = project in file("web") lazy val shared = project in file("shared") But is it possible to define nested projects inside a sub project? Like: lazy val nested = project in file("nested") lazy val...
Freewind
1

votes
1

answer
872

Views

Get reference to jar assembly path in sbt

I'm using sbt-izpack to build an installer. It looks like there's a bug where the variable for the package file name isn't being referenced properly. I'm looking to pass in a variable so that the main jar is properly packaged like so: variables in IzPack += ("artifactName", artifactFileName.value )...
Chris Scott
1

votes
1

answer
2k

Views

How to suppress Warning by sbt compile

I am currently working on project, my project works fine and working. But i want to suppress the warning when i run sbt compile. when i run sbt compile i don't want my terminal to show warning. [warn] /Users/kumarshubham/Documents/repositories/alice/app/misc/QueryDB.scala:14: imported `QueryString'...
Hackaholic
2

votes
2

answer
97

Views

Circular project dependencies with a testkit sbt

I maintain a open source bitcoin library called bitcoin-s. If you look at the build.sbt file you will see that the testkit project depends on the rpc project, and the rpc project depends on the testkit project as a publish dependency inside of our Deps.scala file. This is unfortunate because if we...
Chris Stewart
1

votes
1

answer
297

Views

Apache spark output messages are prepended by [error]

This word count works as expected : System.setProperty("hadoop.home.dir", "H:\\winutils"); val sparkConf = new SparkConf().setAppName("GroupBy Test").setMaster("local[1]") val sc = new SparkContext(sparkConf) def main(args: Array[String]) { val text_file = sc.textFile("h:\\data\\small.txt") val cou...
blue-sky
1

votes
2

answer
825

Views

Sbt can't find Java

When I try to launch sbt, I get the following message: ~(501)$sbt (standard_in) 1: parse error No java installations was detected. Please go to http://www.java.com/getjava/ and download However, both Java and Scala are installed ~(508)$java -version java version "1.8.0_65" Java(TM) SE Runtime Enviro...
rumbo181
1

votes
1

answer
296

Views

How to set base image for DockerPlugin of sbt native packager?

I want to dockerify a scala application. I use the sbt-native-packager, and when building the image locally via sbt docker:publishLocal I was surprised to realize that it would use: openjdk:latest as its base image. I like to point my docker image against certain version, and I know that my applicat...
k0pernikus
1

votes
1

answer
11

Views

sbt compile fails with bad option: '-Ywarn-macros:after'

With a build.sbt file like: ThisBuild / organization := "com.company" ThisBuild / version := "1.0.0-SNAPSHOT" ThisBuild / scalaVersion := "2.11.12" Global / concurrentRestrictions += Tags.limit(Tags.Test, 1) Global / scalacOptions ++= Seq("-Ypartial-unification", "-unchecked", "-Xfatal-warnings", "-...
Metropolis
0

votes
0

answer
3

Views

sbt assembly error:deduplicate: different file contents found in io.netty.versions.properties

I have added the following jar to build.sbt file as follows: "com.amazonaws" % "aws-java-sdk" % "1.11.492" Post this ,during merge , I am getting the following error : [error] 1 error was encountered during merge java.lang.RuntimeException: deduplicate: different file contents found in the followi...
Kishori
1

votes
1

answer
1k

Views

Unresolved Dependencies in SBT Multi Project

Using sbt 13.8, the newest scala plugin for IntelliJ, and a new SBT project with Scala 2.11.7, I try to add a single library - akka 2.4.2. following this, i simply add libraryDependencies += "com.typesafe.akka" %% "akka-actor" % "2.4.2" But I am getting an unresolved dependency error: Error:Error w...
Azeli
1

votes
1

answer
532

Views

Use WSClient in scala app (play framework)

I'm not sure if there's something really basic that I'm missing, but I can't figure out how to use WSClient. I've seen all of the examples saying you need to pass the WSClient to a class as a dependency, which I've done, but when I run the program what do I actually pass to my class? For example, my...
annedroiid
1

votes
1

answer
365

Views

Does every dependency have a “latest” version in sbt/maven?

For example can I always use a "latest" version for every library as follows? "com.kaala.re" %% "brain-builder-client" % "latest"
N A
1

votes
1

answer
84

Views

scala issue with reading file from resources directory

I wrote something like this to read file from resource directory: val filePath = MyClass.getClass.getResource("/myFile.csv") val file = filePath.getFile println(file) CSVReader.open(file) and the result I got was something like this: file:/path/to/project/my_module/src/main/resources/my_module-assem...
DevEx
1

votes
2

answer
29

Views

How to setup SBT from bash from IntelliJ IDEA to avoid formatting characters being broken?

When running on Windows, I have changed my default terminal in the IntelliJ IDE from default Windows cmd to bash (I am using the one installed with Git, located at C:\Program Files\Git\bin\bash.exe). It works very well, the only trouble is that when running sbt from the terminal, some strange charac...
Suma
1

votes
0

answer
19

Views

Unable to get a resource when running an main class or test in sbt

I'm trying to run a test that uses a resource in sbt. The test depends on a util that loads a resource via ClassLoader.getSystemResourceAsStream(...), which results unexpectedly in null. If I run the same test in Intellij or via bazel, the test succeeds. I additionally performed a test by creating a...
jonderry
0

votes
0

answer
6

Views

SBT publish: Repository for publishing is not specified

I am trying to publish artifact with SBT to remote Nexus repository with command sbt publish. My build.sbt: credentials += Credentials("Sonatype Nexus", "nexus.local", "username", "password") publishTo := Some("Sonatype Nexus" at "http://nexus.local:8080/repository/releases") But I get an error: Rep...
Igorock
1

votes
1

answer
103

Views

Automatically check if dependencies are up to date

I'm looking for a tool that will check if the library dependencies in my SBT build definition are up to date. I've heard that such a tool exists, but my Google skills are failing me.
emchristiansen
1

votes
2

answer
1.4k

Views

How to order execution of tests in sbt?

Please suggest best approach how to control order of test/spec execution in sbt? Is there any option like runOrder in maven-sirefire-plugin
Andriy Plokhotnyuk
1

votes
1

answer
431

Views

Trying to open Intellij IDEA lift project generated with gen-idea

I'm trying to get an use the Intellij IDEA for a lift project. I've installed both the sbt and scala plugins and most recently I've followed the instructions here https://github.com/lift/lift_25_sbt. When I open the project, it seems to hang when trying to index the files. It's taking a lot of CPU a...
Jordan
1

votes
1

answer
1k

Views

Sbt building distribution for a project

Is there an easy way to create a distribution for a SBT project, which collects all dependency jars into a single directory like lib and the main project jar file refers to all its dependencies using manifest entries? It would be nice if one could define a main class.
FUD
1

votes
2

answer
736

Views

Play! 2.1 / Why isn't my Jerkson dependency resolved?

Attempting to use the forked Jerkson library from https://github.com/randhindi/jerkson. Cloned a source dependency into the folder module and defined the following: object ApplicationBuild extends Build { val appName = "coolapp" val appVersion = "1.0-SNAPSHOT" lazy val jerkson = Project...
1

votes
1

answer
2k

Views

How configure aspectj compilation in playframework 2.1.1

I have added to plugins.sbt this declaration addSbtPlugin("com.typesafe.sbt" % "sbt-aspectj" % "0.9.0") Now I would like to configure this plugin to compile my java controller classes using aspect library org.springframework:spring-aspects:3.1.4 as with aspectj-maven-plugin I have set this configura...
amertum
1

votes
1

answer
285

Views

Loading an external widget in widgets-config.xml

I am unable to load an iWidget externally on the communities page This is my widget def: But it replaces the http and tries to load it internally "NetworkError: 403 Forbidden - https://connectionsww.demos.ibm.com/communities/ajaxProxy/http/questionmine.com/app1/widgets/index/publishProject_iWidget"...
user2400780
1

votes
2

answer
279

Views

Eclipse not copying resources

Iam using akka 2.1 I have 2 issues: I have an eclipse scala project built using sbteclipse. And it works well. But I have observed that compiling from eclipse does not copy my resources. My structure is: src/main/resources/application.conf src/main/resources/common.conf After compiling, I do not see...
Jatin
1

votes
4

answer
1.7k

Views

SBT not resolving Squeryl dependency

I recently started a new project with the Play! Framework and Scala. I'm used to using Squeryl for my ORM, but for some reason it cannot resolve my dependency this time (Although it will resolve others, just not squeryl). The only thing I'm doing differently is that I'm on a different computer than...
kingdamian42
1

votes
1

answer
104

Views

How to install scala on Heroku?

I want to use a scala script in console on Heroku. So, after command $heroku run bash I try a script ./scala_script.sh, but the result is scala: not found. So, how to install scala or even some package on Heroku? Thanks
krispo
1

votes
2

answer
930

Views

Sbt can't find SbtScalariform

plugins.sbt: resolvers += Classpaths.typesafeResolver resolvers += "Sonatype snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/" resolvers += Resolver.sonatypeRepo("public") addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.5.0-SNAPSHOT") addSbtPlugin("com.typesafe.startscrip...
Alan Coromano
1

votes
2

answer
3.8k

Views

Why does SBT not detect main class in Java? (No main class detected)

SBT will complile, but not run this very simple project. Why not? [email protected]:~/tmp/javahello$ sbt --version sbt launcher version 0.12.1...
Adam Mackler
1

votes
1

answer
877

Views

How to retrieve IBM connections user id for a profile using Profiles API in JAVA?

I am new to IBM SBT and need some help to fetch the userid for a profile based on first name, last name or email id from the IBM connections profiles API. I am planning to do a post on the activity stream on behalf of someone else and I need the user id of this someone else so that I can do a post o...
user2800401
1

votes
1

answer
160

Views

adding another unmanaged source file to my play project

I try to add another source directory to my play project with def temporarySources = Def.setting { (baseDirectory in Compile).value / "temporary" } and then add to settings (unmanagedSources in Compile) += temporarySources.value after running sbt test, sbt complains , that the directory doesn't exis...
coubeatczech
1

votes
2

answer
595

Views

Play Framework 2.2 subprojects

I'm trying to add a subproject to my Play Framework project, and find the docs generally lacking there. I've created a play project, let's call it my-web, and it's in directory /my-cool-project/web. I also have another project I would like my-web to depend on, let's call it my-model. my-model a git...
kozyr
1

votes
2

answer
1.2k

Views

Server access Error while building Apache Spark 0.8.0

UPDATE : No idea how I ended up solving it, but it ended up working with 0.8.0. I think I just got the sources from an other repository which worked this time. While executing sbt/sbt assembly to build Spark on my machine (I'm currently running Ubuntu on VirtualBox, but that shouldn't be the issue),...
Ulysse Mizrahi
1

votes
1

answer
2.5k

Views

SBT in Play Framework can't find org.hibernate dependencies

When I try to implement Hibernate in to a Play Framework 2 application, then it can't find the org.hibernate library. [error] /home/cc/Desktop/eclipses/workspace/muell/app/controllers/HibernateUtil.java:3: error: package org.hibernate does not exist [error] import org.hibernate.Session; [error]...
Crayl
1

votes
2

answer
666

Views

Difference between scalaSource and sourceDirectories in sbt

What is the difference between scalaSource and sourceDirectories? I have a non-standard directory structure where source code lives in src/, This line works in build.sbt: scalaSource in Compile := file("src/") but not sourceDirectories in Compile := Seq(file("src/"))
Hanxue
1

votes
1

answer
325

Views

Play Scala Custom Template Format

I want to use Play Templates to generate source code for a programming language. I'd like to add support for a custom format to the template engine as per Play's documentation. But I do not understand: 1) Where to specify a new file extension? templatesTypes += ("code" -> "some.lang.LangFormat") in...
Rumata Estorsky
1

votes
1

answer
1.4k

Views

Building paths in SBT for the packageMappings of the sbt-native-packager

I am very new to SBT and need to create a RPM package for one of my project. The RPM contains only 1 file, which is a one-jar created by the sbt-onejar plugin). I want to use sbt-native-packager plugin and have created a Packagin.scala file under the /project directory like this: object Packaging {...
reikje
1

votes
1

answer
540

Views

sbt - basic local plugin setup?

I have a particular task I'd like to automate as part of a build process, but I'm stuck at grammar stage with sbt. I'm trying to do a helloworld-ish task using two local projects, one the plugin and one a test using that plugin, but I can't get the new task in the plugin (sampleIntTask) to be avail...
Carl
1

votes
1

answer
362

Views

include upstart scripts when running debian:packageBin

i want to start my scala app as a background service on a ubuntu machine. I'm currently trying to figure out how to use the JavaServerAppPackaging Settings in my package task. Any suggestion, what I have to add where to include the upstart script in my deb file? This is my Project description incl...
magegu

View additional questions