sbt

SBT的下载,安装及配置

倖福魔咒の 提交于 2019-12-28 03:15:45
下载sbt: 下载地址 下载后缀为.msi的可以直接安装 下载完成 双击,按照安装向导安装即可。 安装完成后,配置环境变量,将SBT的主文件夹路径粘贴过去 可以查看,环境变量Path中也自动添加了一个变量(因为下载的安装包是安装版,不是解压版,所以安装过程中会自动配置) 在SBT–>conf文件夹下新建文件repo.properties 设置阿里云镜像 阿里云比较好用的 [ repositories ] local aliyun : http : / / maven . aliyun . com / nexus / content / groups / public / typesafe : http : / / repo . typesafe . com / typesafe / ivy - releases / , [ organization ] / [ module ] / ( scala_ [ scalaVersion ] / ) ( sbt_ [ sbtVersion ] / ) [ revision ] / [ type ] s / [ artifact ] ( - [ classifier ] ) . [ ext ] , bootOnly sonatype - oss - releases maven - central sonatype - oss -

SBT stop run without exiting

泪湿孤枕 提交于 2019-12-28 02:28:06
问题 How do you terminate a run in SBT without exiting? I'm trying CTRL+C but it exits SBT. Is there a way to only exit the running application while keeping SBT open? 回答1: In the default configuration, your runs happen in the same JVM that sbt is running, so you can't easily kill them separately. If you do your run in a separate, forked JVM, as described at Forking, then you can kill that JVM (by any means your operating system offers) without affecting sbt's JVM: fork in run := true 回答2: From

SBT using sbt-native-packager how to create different build files?

好久不见. 提交于 2019-12-25 14:01:23
问题 I have a Play 2.3 Application, following the docs I can build a debian package, the problem comes when I want to build things like this: I have different configurations for dev, qa and prod , and I want to build to 4 different packages, one that contains the code and the others that contains the configuration. so I will get this 4 packages: app-version.deb [this contains the code] app-config-dev-version.deb [this contains the dev configuration] app-config-qa-version.deb [this contains the qa

how to resolve NoSuchMethodError on typesafe config?

吃可爱长大的小学妹 提交于 2019-12-25 07:48:42
问题 I'm getting this error when trying to run my project. Exception in thread "main" java.lang.NoSuchMethodError: com.typesafe.config.Config.getDuration(Ljava/lang/String;)Ljava/time/Duration; tried to clear ivy2 cache with no success . this is how my build sbt looks like : scalaVersion := "2.11.7" scalacOptions := Seq("-unchecked", "-feature", "-deprecation", "-encoding", "utf8") resolvers ++= Seq( Resolver.sonatypeRepo("releases"), Resolver.sonatypeRepo("snapshots"), Resolver.bintrayRepo(

Use SBT to launch an applicative task/batch?

▼魔方 西西 提交于 2019-12-25 07:39:42
问题 Can SBT be used to launch applicative Scala batches? I mean, a Scala applicative code that would decrement all the user's balance for exemple. I can imagine a special SBT project for that with a build dependency on the applicative code, so that some SBT tasks of the project can launch this applicative code. Would you do such a thing? Why? What are the alternatives to ease the launch of applicative batches in Scala? With Maven I used to use the appassembler plugin which would generate sh

Why is Eclipse not able to resolve Guice import in Play 2.2.x application?

谁说我不能喝 提交于 2019-12-25 07:06:56
问题 I'm trying to use Google Guice Injections in my Play 2.2.2 project. My build.sbt file contains this: libraryDependencies ++= Seq( javaJdbc, javaEbean, cache, "com.google.inject" % "guice" % "4.0-beta", "ws.securesocial" %% "securesocial" % "2.1.4", "postgresql" % "postgresql" % "9.1-901-1.jdbc4" ) When running play dependencies , I can see that the guice dependency is being resolved correctly. However, when trying to make the import com.google.inject.* statement it seems that the library is

Play 2.5 - Run a Java method at certain times of day (cron)

余生长醉 提交于 2019-12-25 06:56:10
问题 I'm working on a Play 2.5 app that needs to run a method at midday, 2pm, 4pm every day autonomously. So far I have followed another answer on here which has got me most of the way. The application.conf file has been updated to look at the Module file, which binds to the OnStartup() method correctly. I believe the issue is to do with the code in the OnStartup() method, I've included the code below - is this the correct way to get something to run at certain times of day? package controllers;

How to specify which java version to use with sbt 0.12.4?

给你一囗甜甜゛ 提交于 2019-12-25 06:13:15
问题 How to specify which java version to use with sbt 0.12.4? I have java 7 and java 8 installed. Since sbt 0.12.4 does not support java 8 but tries to use it by default, I have to specify java version explicitly for sbt. I want to keep using java 8 as a default version of java for other things. 回答1: One way that works well for me is, using the sbt script from sbt-extras and add to the root of the project a file called .sbtopts with: -java-home /Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk

Scala环境搭建(on CentOS 6)

扶醉桌前 提交于 2019-12-25 04:57:56
一、安装JDK 注:Scala运行在JVM之上,需要安装JDK作为前提,并选择版本为1.7.*,与Scala 2.10.*版本兼容性较好 1. 下载:从 http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html 下载JDK安装文档 jdk-7u72-linux-x64.tar.gz 2. 解压:解压安装文档到指定目录 /usr/java/ 3. 环境变量:打开 ~/.bashrc ,追加 bin/ 文件夹目录至 PATH 环境变量中 export JAVA_HOME=/usr/java/jdk1.7.0_75 export PATH=$PATH:$JAVA_HOME/bin export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar 4. 验证:打开新的Terminal,键入 java –version java version "1.7.0_72" Java(TM) SE Runtime Environment (build 1.7.0_72-b14) Java HotSpot(TM) 64-Bit Server VM (build 24.72

SBT hangs when running with chef solo

痴心易碎 提交于 2019-12-25 04:35:16
问题 I'm running SBT under chef-solo, and it hangs trying to read from the terminal. Redirecting /dev/null into it doesn't help, even if I run the jar directly with java. It only works if I orphan it, and will only terminate when the parent chef-solo terminates. It must be closing stdin, and then reopening it, thus getting the stdin of the parent. The stack trace during the hang seems to indicate that. I suspect it has something to do with one of the plugins Thread 22379: (state = IN_NATIVE) -