TL;DR: How can I fully reconcile all dependencies in IntelliJ when SBT file changes
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.
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.
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.
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.
You can use Pretty Clean to clean the all of dev tools caches including SBT. PrettyClean also cleans the SBT project's target folder.
Press Ctrl+Alt+S to open the IDE settings and select Build, Execution, Deployment | Build Tools | sbt. In the sbt projects section, select a project for which you want to configure build actions. In the sbt shell section, select the builds option. Click OK to save the changes.
Removes all generated files from the target directory. Compiles source code files that are in src/main/scala, src/main/java, and the root directory of the project. Automatically recompiles source code files while you're running SBT in interactive mode (i.e., while you're at the SBT command prompt).
To refresh IntelliJ after changes made in *.sbt files:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With