Intellij exclude file from being compiled

后端 未结 2 436
猫巷女王i
猫巷女王i 2020-12-10 02:44

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 t

相关标签:
2条回答
  • 2020-12-10 03:19

    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.

    0 讨论(0)
  • 2020-12-10 03:32

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

    enter image description here

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

    enter image description here

    0 讨论(0)
提交回复
热议问题