sbt

Play 2.0 “management” console commands

谁说我不能喝 提交于 2019-12-22 09:04:15
问题 I'd like to create some custom commands to manage my play 2.0 application (similar to Django's management commands), so I can run things like play import-data <data> . This seems to be something one would do by writing SBT commands (like Play's own), but specific to the particular project and with access to a project's resources (models etc.) Being fairly new to Scala, and new to both Play and SBT, I cannot get my head around how to do this, and particularly the dependency management that is

Where should the SBT credentials configuration go?

谁都会走 提交于 2019-12-22 08:52:54
问题 I'm running SBT 1.1.1 on Windows. If I put the following line in my build.sbt, my build is OK: credentials += Credentials(Path.userHome / ".sbt" / ".credentials") The trouble is, I don't particularly want to leave this kind of machine-specific configuration in my project. Also, in order to use g8 templates I need to have a working global config. But if I put the same text in a file called credentials.sbt in the following directories it seems not to work. %USERPROFILE%/.sbt/1.1/plugins

How to build using SBT in offline mode

心不动则不痛 提交于 2019-12-22 08:52:38
问题 What is the equivalent of mvn -o in SBT? When I check my .ivy repository, I can see the dependecy jars in cache/groupId/artifactId/jars . When I try to build it without internet connection, it still does this Resolving ... thing and shows Unresolved Dependencies error. How can I turn this off? I tried using sbt set-offline := true but still gets the error. Is this possible? Maybe download once and save the artifacts in .m2 like maven and get it from there if its not possible in .ivy 回答1: Are

Include sub-module artifacts in SBT multi-project build

对着背影说爱祢 提交于 2019-12-22 08:37:35
问题 I have a multi-project build that makes extensive use of sub-projects in order to make dependencies between them explicit (by means of dependsOn - the sub-projects act as layers). If it comes to publishing I want to roll up all the sub-project artifacts into the artifact of the main project (jar), and collect all their libraryDependencies. In other words, I want to publish as if there would be no sub-projects, just a single root project containing all my code (i.e. no ueber-jar). The sub

How to run sbt multiple command in interactive mode

白昼怎懂夜的黑 提交于 2019-12-22 08:34:02
问题 I want to run several sbt-commands within sbt interactive mode, i.e. without leaving the sbt "shell"? (Note: Some questions answer how to pass argument to sbt-commands using sbt in the standard shell. Not what I wnat here) Example: I am in sbt interactive shell, and I want to run "test:compile", then "test" I know test will call required compilation, but in this example I want to run the compilation of all sub-projects, before any test is started. 回答1: To run commands sequentially within the

Error installing sbt on Ubuntu 18.04: `gpg: keyserver receive failed: Invalid argument` [closed]

允我心安 提交于 2019-12-22 08:24:41
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 months ago . I'm following the official sbt install instructions. $ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823 Executing: /tmp/apt-key-gpghome.uRI0yiusG0/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823 gpg:

Can Apache Ivy handle dependencies in p2 repositories?

女生的网名这么多〃 提交于 2019-12-22 08:19:59
问题 I considered using SBT (which resolves dependencies using Ivy) to build an Eclipse RCP application. Is it possible? 回答1: If you can access the p2 repository via the standard ivy resolvers(listed here: http://ant.apache.org/ivy/history/latest-milestone/settings/resolvers.html) then it should be possible. 来源: https://stackoverflow.com/questions/6256963/can-apache-ivy-handle-dependencies-in-p2-repositories

trait Build in package sbt is deprecated: Use .sbt format instead

左心房为你撑大大i 提交于 2019-12-22 06:57:23
问题 Using sbt 0.13.5, when opening the project in IntelliJ, there is a warning message ~\myproject\project\Build.scala:5: trait Build in package sbt is deprecated: Use .sbt format instead The content of the Build.scala is import sbt._ object MyBuild extends Build { lazy val root = Project("MyProject", file(".")) .configs(Configs.all: _*) .settings(Testing.settings ++ Docs.settings: _*) } The Appendix: .scala build definition and the sbt documentation is rather overwhelming. How to merge my

Should sbt-assembly perform a “maven-shade-plugin”-like relocation of classes?

谁说胖子不能爱 提交于 2019-12-22 06:45:11
问题 The description of sbt-assembly merge strategy called rename sounded like it might permit something similar to the shading operation of the maven-shade-plugin which will relocate classes and their references to permit the management of incompatible versions of libraries. Would it be appropriate for sbt-assembly to perform that function? I used the following merge strategy to attempt to use rename as a relocation mechanism but while it matches all the files, it passes them straight through

How do I consume -D variables in build.scala using SBT?

故事扮演 提交于 2019-12-22 06:26:47
问题 I have a build.scala file that has a dependency that looks like this: "com.example" % "core" % "2.0" classifier "full-unstable" This pulls in a JAR with the classifier of full-unstable What I need to do is specify either "unstable" or "stable" to SBT (using a -D I presume) from Jenkins (the build server) to change the classifier. If variable substitution worked like it does in Maven, the dependency would look like: "com.example" % "core" % "2.0" classifier "full-${branch}" And I would do "