scala - 如何更改项目的 sbt 版本
问题描述
我在项目中有 build.properties 文件,其中包含以下行:
sbt.version=1.2.8
build.properties 文件与 build.sbt 文件位于同一文件夹中。
但是当我输入命令“sbt about”时,它会报告 1.0.3。以下是该命令的实际输出:
/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?
解决方案
您的项目结构应该是<root>/project/build.properties
,然后您应该更改 sbt 版本属性(参见https://github.com/pedrorijo91/play-slick3-steps/blob/master/project/build.properties作为示例)
用于sbt about
了解正在使用的版本。
推荐阅读
- qt - QML 文本中的多种字体类型
- java - 我应该将 bean 定义放在 Spring MVC 项目中的哪里?
- c# - C# wpf 搜索文本并在使用滚动视图虚拟化堆栈面板中查找下一个功能
- javascript - 在触发 Dom 事件之前更新 React 组件(onBlur 和 onClick)
- mysql - 产品“MySQL Server 8.0.11”的“安装”操作失败
- arrays - 我可以在循环中将对象添加到数组中,然后在同一行中返回数组吗?
- javascript - JSON文件的前3个值
- shell - AIX 中的集群命令
- python - Docker:从同一个镜像运行多个脚本(容器)
- list - 如何将列表中的偶数增加三倍?