sbt 大约给出 0.13.15,而我已经安装了 sbt 1.0.4 [英] sbt about gives 0.13.15 while i have installed sbt 1.0.4
问题描述
sbt 新手,我在这里安装了 sbt 表单 https://www.scala-sbt.org/download.html
(windows sbt-1.0.4.msi) 然后我做 sbt about
它产生了
Hi new to sbt i have installed sbt form here https://www.scala-sbt.org/download.html
(windows sbt-1.0.4.msi) and then i do sbt about
it yields
C:\Users\rajnish.kumar>sbt about
"C:\Users\rajnish.kumar\.sbt\preloaded\org.scala-sbt\sbt\"1.0.4"\jars\sbt.jar"
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[warn] Executing in batch mode.
[warn] For better performance, hit [ENTER] to switch to interactive mode, or
[warn] consider launching sbt without any commands, or explicitly passing 'shell'
[info] Loading project definition from C:\Users\rajnish.kumar\project
[info] Set current project to rajnish-kumar (in build file:/C:/Users/rajnish.kumar/)
[info] This is sbt 0.13.15
[info] The current project is {file:/C:/Users/rajnish.kumar/}rajnish-kumar 0.1-SNAPSHOT
[info] The current project is built against Scala 2.10.6
[info] Available Plugins: sbt.plugins.IvyPlugin, sbt.plugins.JvmPlugin, sbt.plugins.CorePlugin, sbt.plugins.JUnitXmlReportPlugin, sbt.plugins.Giter8TemplatePlugin
[info] sbt, sbt plugins, and build definitions are using Scala 2.10.6
问题是为什么要打印 sbt 版本 0.13.15 而不是 1.0.4 ?.我使用的是 Windows 8.
Question is why it is printing sbt version 0.13.15 instead of 1.0.4 ?. i am using windows 8.
您好,在 Windows 10 上尝试了相同的操作并获得了预期的结果
hi tried the same thing on windows 10 and getting the expected result
C:\Users\rajnish>sbt about
"C:\Users\rajnish\.sbt\preloaded\org.scala-sbt\sbt\"1.0.4"\jars\sbt.jar"
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[info] Loading project definition from C:\Users\rajnish\project
[info] Set current project to rajnish (in build file:/C:/Users/rajnish/)
[info] This is sbt 1.0.4
[info] The current project is {file:/C:/Users/rajnish/}rajnish 0.1-SNAPSHOT
[info] The current project is built against Scala 2.12.4
[info] Available Plugins: sbt.plugins.IvyPlugin, sbt.plugins.JvmPlugin, sbt.plugins.CorePlugin, sbt.plugins.JUnitXmlReportPlugin, sbt.plugins.Giter8TemplatePlugin
[info] sbt, sbt plugins, and build definitions are using Scala 2.12.4
推荐答案
为了在构建项目时真正强制执行 SBT 版本,您应该在 project/build.properties
文件中指定此版本.这是我项目中这个文件的内容:
In order to really enforce SBT version when building your project you should specify this version in the project/build.properties
file. Here is the content of this file in my project:
sbt.version = 1.0.4
如果我导航到根项目文件夹并运行 sbt about
它会显示我
If I navigate to the root project folder and run sbt about
it shows me
[info] This is sbt 1.0.4
[info] The current project is {file:/ssd2/projects/ADMP/}admp 1.0
[info] The current project is built against Scala 2.11.9
如果我将 build.properties
中的版本更改为
If I change the version in the build.properties
to
sbt.version = 1.0.1
然后运行 sbt about
它显示我
and then run sbt about
it shows me
[info] This is sbt 1.0.1
[info] The current project is {file:/ssd2/projects/ADMP/}admp 1.0
[info] The current project is built against Scala 2.11.9
SBT 知道如何加载特定版本的源,如果当前版本的 SBT 不同,则加载它们,编译该版本的 SBT,然后使用该版本的 SBT 构建您的项目.
SBT knows ho to load particular version sources, loads them if current version of SBT is different, compiles that version of SBT and then builds your projec with that version of SBT.
为什么它在您的情况下默认显示 0.13.15 - 我不确定.可能在您的项目中,您在 build.properties
中指定了该版本,可能是出于其他一些原因.
Why it shows by default 0.13.15 for your case - I am not sure. Probably in your project you have that version specified in the build.properties
, probably for some other reasons.
尝试在 sbtVersion
任务的帮助下检查.运行命令 sbt sbtVersion
.
Try also check with help of sbtVersion
task. Run the command sbt sbtVersion
.
这篇关于sbt 大约给出 0.13.15,而我已经安装了 sbt 1.0.4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!