ShacharSh
ShacharSh

Reputation: 510

How to prevent IntelliJ from asking to provide the Scala SDK after every Gradle build?

I'm using IntelliJ IDEA (15.0.3) to write a project in Scala over Spark. Every time I build using the following command

./gradlew clean build idea

IntelliJ pops up the message 'No Scala SDK in module' and asks to setup the Scala SDK version.

Is there a way to permanently specify the SDK version so that building with Gradle won't override it?

Upvotes: 3

Views: 1359

Answers (1)

alextsc
alextsc

Reputation: 1368

In general you don't need to run the idea task with every build. That task generates IDEA project files so you're able to open the project from within the IDE - you usually only need to run it once when setting up the project. Running the task over existing project files can (partially) overwrite them, depending on how the task is configured and apparently does override the SDK configuration changes made in your case.

So just running ./gradlew clean build when building should solve your issue (unless I'm missing/misunderstanding part of your question).

Upvotes: 1

Related Questions