如何更改项目的 sbt 版本 [英] How to change sbt version for project

查看:67
本文介绍了如何更改项目的 sbt 版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在项目中有 build.properties 文件,其中包含以下行:

I have build.properties file in the project with the following line:

sbt.version=1.2.8

build.properties 文件与 build.sbt 文件在同一个文件夹中.

build.properties file is in the same folder as build.sbt file.

但是当我输入命令sbt about"时,它报告了 1.0.3.以下是命令的实际输出:

But when I enter the command "sbt about", it reports 1.0.3. Following is the actual output of the command:

/Users/kale> sbt about
[info] Loading settings from idea.sbt ...
[info] Loading global plugins from /Users/kale/.sbt/1.0/plugins
[info] Loading settings from plugins.sbt ...
[info] Loading project definition from 
/Users/kale/workspace/gr8Project/myapp/project
[info] Loading settings from build.sbt ...
[info] Set current project to myapp (in build 
file:/Users/kale/workspace/gr8Project/myapp/)
[info] This is sbt 1.0.3
[info] The current project is 
{file:/Users/kale/workspace/gr8Project/myapp/}myapp 0.1-SNAPSHOT
[info] The current project is built against Scala 2.12.8
[info] Available Plugins: sbt.plugins.IvyPlugin, 
sbt.plugins.JvmPlugin, sbt.plugins.CorePlugin, 
sbt.plugins.JUnitXmlReportPlugin, 
sbt.plugins.Giter8TemplatePlugin, sbtassembly.AssemblyPlugin, 
com.lucidchart.sbt.scalafmt.ScalafmtCorePlugin, 
com.lucidchart.sbt.scalafmt.ScalafmtPlugin, 
com.lucidchart.sbt.scalafmt.ScalafmtSbtPlugin, 
scoverage.ScoverageSbtPlugin, 
net.virtualvoid.sbt.graph.DependencyGraphPlugin, 
sbtdocker.DockerPlugin, Build, Docker
[info] sbt, sbt plugins, and build definitions are using Scala 
2.12.4

如何将 sbt 版本更改为 1.2.8?

How can I change sbt version to 1.2.8?

推荐答案

你的项目结构应该是/project/build.properties,然后你应该改变sbt版本属性(见 https://github.com/pedrorijo91/play-slick3-steps/blob/master/project/build.properties 为例)

your project structure should be <root>/project/build.properties, and then you should change the sbt version property (see https://github.com/pedrorijo91/play-slick3-steps/blob/master/project/build.properties as an example)

使用sbt about可以知道正在使用的版本.

Use sbt about to know the version in use.

这篇关于如何更改项目的 sbt 版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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