IntelliJ Cannot Import sbt Project

前端 未结 14 1900
Happy的楠姐
Happy的楠姐 2021-01-29 23:14

I have upgraded IntelliJ to version CE 2017.3 from a CE 2017.2.5, and now I cannot build my sbt project. The build gets stuck on the first step:

\"Build: sync
           


        
相关标签:
14条回答
  • 2021-01-29 23:57

    Simply unchecking 'sbt sources' did the trick for me

    0 讨论(0)
  • 2021-01-30 00:01

    I have suffered from same problems after upgrade intelliJ to 2017.3 But it works fine now.

    I think intelliJ couldn't pass the 'No proxy for' option to sbt. so, I added

    -Dhttp.nonProxyHosts="host1|host2"

    option in File > Settings > Build, Excution, Deployment > sbt > VM parameters

    0 讨论(0)
  • 2021-01-30 00:05

    Had an older checked out project causing this issue. Did the usual rm -rf .idea + re-import but it kept getting stuck. Tried all sorts of things, but when finally fixed it for me was not just deleting the top-level target folder, but instead doing

    find . -name target -type d -exec rm -rf {} \;
    

    Next open / import went flawlessly. (This was on 2018.1.5, 2018.1.6 and 2018.2 RC.)

    0 讨论(0)
  • 2021-01-30 00:06

    For me, simply checking use sbt shell for both build and imports worked.

    0 讨论(0)
  • 2021-01-30 00:08
    • Open a terminal inside IDEA by pressing Alt F12 or use sbt shell
    • Run sbt - if it is first time it will take some time.
    • Run clean
    • Run compile - it will download dependencies you have in your project.
    • Close IDEA project (File -> Close Project) and open it again.

    Note: if it asks to import in the right-bottom of the screen activate Enable auto-import, if you don't like to keep it enabled (like me) press Import, cancel the syncronyzation and then Refresh sbt project again. When you try to use import in the middle of a sync it gets stuck with dump project structure from sbt message.

    The Refresh sbt project is located at this corner of the Build Sync window - highlighted below:

    0 讨论(0)
  • 2021-01-30 00:09

    I have not found a way to make this work in IntelliJ Idea CE 2017.3, so I have reverted to CE 2017.2.5

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