项目导入需要 Sbt 0.12.4+ [英] Sbt 0.12.4+ required on project import

查看:24
本文介绍了项目导入需要 Sbt 0.12.4+的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在阅读 Peter Hilton(出版商:Manning)的 Play for Scala: Covers Play 2 一书,并试图坚持他们在书中概述的版本(Play 版)2.1.1).

I'm currently reading the Play for Scala: Covers Play 2 book by Peter Hilton (publisher: Manning) , and trying to stick to the versions they've outlined in the book (Play version 2.1.1).

我下载并安装了新的 IntelliJ IDEA 14 CE 应用程序.我目前正在导入该项目,但它失败了,因为它需要 0.12.4 或更高版本的 sbt.

I downloaded the new IntelliJ IDEA 14 CE app and installed it. I'm currently importing the project, and it's failing because it wants a version of sbt that is 0.12.4 or greater.

这个问题前几天发生在 13,但我还没来得及解决它,所以请不要建议回到 13 :)

This issue occurred in 13 the other day, but I haven't had time to resolve it, so please, no recommendations to go back to 13 :)

这里是问题的核心:当我在 CLI 上输入 sbt --version 时,它会打印 sbt launcher version 0.13.6. 我有一个更高"的版本,但 IDEA 似乎没有认识到这一点.

Here is the meat of the issue: When I type sbt --version on the CLI, it prints sbt launcher version 0.13.6. I have a "greater" version, but it appears that IDEA doesn't recognize this.

为了指定我自己的 SBT 启动器 JAR,我将我的自定义启动器(在 IDEA 全局设置中)指向 /usr/local/Cellar/sbt/0.13.6/libexec/sbt-launch 中的那个.jar,但构建也失败并出现相同的错误.

In an effort to specify my own SBT launcher JAR, I pointed my custom launcher (in IDEAs global settings) to the one in /usr/local/Cellar/sbt/0.13.6/libexec/sbt-launch.jar, but the build also failed with the same error.

此时您可能已经猜到了,我使用 Homebrew 来安装和管理 Scala 和 sbt.当我在二月份第一次开始使用 Scala 时,我记得必须在我的设置中进行一些小的调整才能让 IDEA 找到 Scala,但是我的 IDEA 14 版本是全新的——我没有导入任何以前的设置.我下载了 Scala 和 sbt 插件,粗略查看并创建了一个新的测试项目后,它们似乎已正确配置.

As you may have guessed at this point, I have used Homebrew to install and manage Scala and sbt. When I first started working with Scala back in February, I remember having to make a few small tweaks in my settings to get IDEA to find Scala, but my version of IDEA 14 is totally fresh -- I did not import any previous settings. I downloaded the Scala and sbt plugins and they appear to be properly configured after a cursory look and creation of a new test project.

以下是我不明白的地方:首先,也是最明显的,为什么满足假定要求 (0.12.4+) 的 sbt 版本会在 0.13.* 版本中失败?

Here is what I'm failing to understand: First, and most obvious, why would an sbt version that meets the supposed requirement (0.12.4+) fail with version 0.13.*?

其次,IDEA捆绑的sbt是不是也比这个版本大?我的系统中是否可能有一个 sbt 标志指向早期版本?旁注,我的Cellar"中有几个版本的 sbt,但都大于 0.13.

Second, is the bundled sbt with IDEA also greater than this version? Is there possibly an sbt flag somewhere in my system that's pointing it to an earlier version? A side note, I have a few versions of sbt in my "Cellar", but all are greater than 0.13.

非常感谢您的帮助!

推荐答案

我查看了 Manning 网站的代码示例,每个项目的 project/build.properties 文件都指定了 sbt.version=0.12.2.我的猜测是 Intellij Scala 插件仅支持 SBT 0.12.4,并且无法导入配置为使用旧版本的项目(因此它建议您更新您的项目定义").

I had a look at the code samples from Manning's website, and the project/build.properties files for each project specify sbt.version=0.12.2. My guess is that the Intellij Scala plugin only supports SBT 0.12.4, and cannot import you project which is configured to use an older version (hence why it recommends that you "update your project definition").

您应该尝试在 project/build.properties 文件中使用 sbt.version=0.12.4.

You should try using sbt.version=0.12.4 in the project/build.properties file.

一般来说,请记住,当在 project/build.properties 中指定 SBT 版本时,SBT 启动器会下载指定的版本并使用它来构建项目.就您而言,这意味着 SBT 0.13.6 启动器将下载 SBT 0.12.2 并使用该版本构建项目.

Generally speaking, keep in mind that when an SBT version is specified in project/build.properties, the SBT launcher downloads the specified version and uses it to build the project. In your case, that means that the SBT 0.13.6 launcher will download SBT 0.12.2 and use that version to build the project.

这篇关于项目导入需要 Sbt 0.12.4+的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆