简体   繁体   中英

Intellij exclude file from being compiled

I am trying to exclude a particular file in my project from being compiled.

According to the Intellij IDEA documentation you do this by "marking the file as plain text".

However, the context menu in the project view where this functionality is supposedly located has no such action. I am using version 13.02 of Intellij. Here is what my context menu looks like:

在此输入图像描述

Under File > Settings > Build, Execution, Deployment > Compiler > Excludes, add an entry.

在此输入图像描述

Any attempts to run a path specified here will result in a ClassNotFoundException , and a very important class indicator as well.

在此输入图像描述

Just to compound on Makoto's answer (would comment but don't have reputation), it looks like this feature does not apply to classes (.java) or assets (images)...for these types of files, it looks like you will need to actually go to the compiler and explicitly state that the file(s) should be excluded.

However, for .htm, .xml, or really anything that isn't a class or asset you will find and can use the 'Mark as plain text' option.

Edit: It looks like you can also go to the 'Messages Make' error / warnings view and Exclude from there, a little less work IMHO. 消息快捷方式

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