Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IDEA cannot re-import sbt project

It happens often with current stable version of (Community) IDEA (2021.1.2) and Scala plugin (2021.1.21) that I make changes under Windows on an sbt file (sbt version 1.5.3 for example), IDEA shows that it needs to import, but it fails with:

Extracting structure failed, reason: not ok build status: Error (BuildMessages(Vector(),Vector(),Vector(),Vector(),Error))

The sbt files are correct (also the error message is not very helpful). I also have sbt shell running, though it is not executing anything.

Here is the sbt related configuration of IDEA (Build, Execution, Deployment | Build Tools | sbt): IDEA settings for sbt

like image 995
Gábor Bakos Avatar asked Jun 27 '21 11:06

Gábor Bakos


People also ask

Why sbt is not showing in IntelliJ?

To enable that, we need to go into our project preferences and specify that behavior. Note checkboxes next to the label, “Use sbt shell”. Enable “for imports” and “for builds” and then click “OK”. This will cause IntelliJ to run an instance of SBT to both build and to manage project dependencies.


1 Answers

I also have sbt shell running, though it is not executing anything.

This is the problem. When sbt shell is not used for project reload, it prevents importing the project.

The possible solutions include stopping the sbt shell during the import or change the setting "Build, Execution, Deployment" | "Build Tools" | "sbt" | "sbt projects" | "sbt shell" | "use for:" | "project reload" to be checked.

project reload to be enabled

like image 128
Gábor Bakos Avatar answered Sep 17 '22 06:09

Gábor Bakos