sbt about gives 0.13.15 while i have installed sbt 1.0.4

China☆狼群 提交于 2019-12-25 01:32:39

问题


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

Question is why it is printing sbt version 0.13.15 instead of 1.0.4 ?. i am using windows 8.

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

回答1:


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

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

If I change the version in the build.properties to

sbt.version = 1.0.1

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 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.

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.

Try also check with help of sbtVersion task. Run the command sbt sbtVersion.




回答2:


For me it turned out be not so clean installation. Step I have done to fix this:
1. Manually delete sbt installation directory from Program files.
2. Delete the directory c:\Users\.sbt
3. Uninstall sbt using add remove program.
4. Install sbt new version.
5. Cross check environment variables e.g.SBT_HOME and path
6. Run sbt sbtVersion to verify new installed version.



来源:https://stackoverflow.com/questions/47806732/sbt-about-gives-0-13-15-while-i-have-installed-sbt-1-0-4

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!