如何在IDEA中完全清理,重新解析和重建Scala sbt管理的项目? [英] How to fully clean, re-resolve and rebuild a Scala sbt-managed project in IDEA?

查看:499
本文介绍了如何在IDEA中完全清理,重新解析和重建Scala sbt管理的项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

TL; DR:当SBT文件更改时如何完全协调IntelliJ中的所有依赖关系

TL;DR: How can I fully reconcile all dependencies in IntelliJ when SBT file changes

我在IntelliJ中设置了SBT项目.在大多数情况下,如果它像一个咒语一样工作,但更改依赖项和编译器的版本对我来说是一个痛苦.

I have a SBT project setup in IntelliJ. For the most part if works like a charm, but it is quite a pain for me, to change the version of the dependencies and compilers.

我希望做的是更新我的SBT文件,然后在IntelliJ中单击诸如 clean project 之类的东西,以便它保持最新状态.

What I hope to do, is to update my SBT file, and click something like clean project in IntelliJ, so it gets up to date.

我找到的最好的菜单项是 Rebuild project .它读取新的依赖关系,但保留旧的依赖关系,因此,外部库包含Scala运行时和第三方库的多个版本.

The best menu item I have found is Rebuild project. It reads new dependencies, but keeps the old ones around, so External Libraries contains multiple versions of the Scala runtime and 3rd party libraries.

要解决此问题,我可以关闭IntelliJ并删除.idea/libraries中的所有文件.当我重新启动IntelliJ时,它将重新解析依赖性.可以,但是手动删除元数据文件表示我做错了事.

To get around this I can close IntelliJ and delete all files in .idea/libraries. When I restart IntelliJ it will re-resolve the dependencies. It works, but manually deleting metadata files indicates that I am doing the wrong thing.

推荐答案

在* .sbt文件中进行更改后刷新IntelliJ:

To refresh IntelliJ after changes made in *.sbt files:

  • 打开"SBT项目"窗格(菜单视图/工具窗口/SBT)
  • 右键单击您的SBT项目
  • 选择刷新外部项目

这篇关于如何在IDEA中完全清理,重新解析和重建Scala sbt管理的项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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