How to fully clean, re-resolve and rebuild a Scala sbt-managed project in IDEA?

前端 未结 10 674
一向
一向 2021-02-02 06:18

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 l

相关标签:
10条回答
  • 2021-02-02 06:52

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

    • Open the SBT Project pane (Menu View / Tool WIndows / SBT)
    • Right click on your SBT project
    • Select Refresh external project

    0 讨论(0)
  • 2021-02-02 06:52

    If you are using the activator through a terminal/shell/command prompt use the following command:

    activator clean
    

    Or just "clean" on the sbt shell through intellij

    It should help reset things and next time you run or compile, it should go through it from scratch.

    0 讨论(0)
  • 2021-02-02 06:52

    What worked for me was to:

    1) Close IntelliJ

    2) delete .idea/libraries internals

    3) Start IntelliJ

    4) right-clicked pom.xml Maven > Reimport

    After that there were no old versions and duplicate libraries in the External Libraries.

    0 讨论(0)
  • 2021-02-02 06:54

    Has happened to me before, and yes, is a PITA.

    What I usually do is to manually remove the dependencies from the project, all of them, then let sbt re-import what is actually needed. Don't do it on the UI though, since even having multiple selection, will ask for confirmation for EVERY dependency! (you will be clicking "Yes, I'm sure" for an hour), instead, go and delete directly from the .iml project file on your .idea/modules directory.

    0 讨论(0)
提交回复
热议问题