Vitalii
Vitalii

Reputation: 11071

Disable tests compilation in Intellij

I have a java maven project, and I make some changes to it. Those changes broke compilation of the tests, and for now, I don't want to fix them (as I don't know if my idea works or not).

Is there a way to altogether disable tests compilation and make my project run?

Upvotes: 4

Views: 10934

Answers (1)

Peter
Peter

Reputation: 5184

Yes there is.

Got to Settings -> Build,Ex.. -> Compiler -> Excludes and press the + button: enter image description here

select the path you want to exclude. In your case it's the test folder: enter image description here

Check the recursive checkbox on the right side and you should see that your test folder has no a little x on the folder to mark it as excluded:

BTW: Remeber these little x, because Intellij IDEA provides an intention to exclude certain package from compilation. Executing that intention by accident could lead to a long journey of searching and asking in order to understand why certain packages aren't build anymore.

enter image description here

Upvotes: 9

Related Questions