How to enable partial build in intellij (Gradle)?

Despite reading this popular post, I couldn’t find the solution to building only a subset of a Java project.

So far I’ve tried:

  • Creating a new run/debug configuration with Build, no error check and removing Build.
  • Under Build, Execution, Deployment > Compiler, I have unchecked Automatically show first error in editor.
  • Inside Build, Execution, Deployment > Compiler > Java Compiler, I have selected Eclipse and checked Proceed on errors.

EDIT

I am using the latest version of Intellij with Gradle and JDK 1.8. I wrote some gibberish inside BrokenOnPurpose.java and the objective was to get the compiler to ignore the file. But instead, I get a “Task compileJava failed” with an error, stopped dead in its tracks.

src
├── main
│   ├── java
│   │   ├── BrokenOnPurpose.java
│   │   └── Main.java (*)
│   └── resources
└...
(*) entry method

Answer

You need to disable gradle build delegation for your compiler settings to have effect.

Leave a Reply

Your email address will not be published. Required fields are marked *