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
The only way I could work around this was by running sbt clean compile
in the SBT console/cmd line first, then refreshing the SBT project in IntelliJ.
Custom SBT version works for me.
IntelliJ IDEA Preferences -> Build,Execution,Deployment -> Build Tools -> sbt -> Launcher
Choose Custom
I solved the sync issue following info here: https://youtrack.jetbrains.com/issue/SCL-13024
Key info is "It seems that sbt is trying to re-resolve 'sources' and 'docs' for sbt plugins that are not available at all. If properties to download "Library sources" and "sbt sources" are disabled, then time to dump the structure is reduced from 'forever' to less than 1 minute."
That is , in IntelliJ IDEA, clear the check box "Library sources" under "Project level settings" for Build Tools sbt in IDEA preferences. As shown in image below:
IntelliJ appears to limit the efficiency of the already slow sbt update
. I recommend using sbt-coursier instead. It was written specifically to improve dependency update time, and on one large project I'm involved in it improved dependency update time by about 2 orders of magnitude.
Preferences > Build, Execution, Deployment > Build Tools > sbt
to prevent IntelliJ from auto updating imports on its ownaddSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.0.3")
to your project's build.sbt
file
~/.sbt/1.0/plugins/build.sbt
sbt update
on the command lineIf you see [error] java.lang.NoClassDefFoundError: org/vafer/jdeb/Console
, then add the following to ~/.sbt/1.0/sbt-coursier.sbt
.
import coursier.Keys._
classpathTypes += "maven-plugin"
See coursier issue #450 for more information about that error.
I was also facing this issue. Below two configurations worked for me. I tried to confirm this setting in many new sbt projects, for all it worked.
(1) uncheck "Library sources" under "Project level settings" for Build Tools sbt in IDEA preferences (2) -Dhttp.nonProxyHosts="host1|host2" option in File > Settings > Build, Excution, Deployment > sbt > VM parameters
What worked for me was to increase the memory for SBT inside IntelliJ. On my Mac: preference -> Build, Execution, Depoyment -> sbt then change "Maximum heap size" from 768MB to 2048MB and then everything was successfully imported after few minutes.