简体   繁体   中英

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?

Yes there is.

Got to Settings -> Build,Ex.. -> Compiler -> Excludes and press the + button: 在此处输入图片说明

select the path you want to exclude. In your case it's the test folder: 在此处输入图片说明

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.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM