且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

IntelliJ:禁用单个模块的警告/错误

更新时间:2022-05-15 20:48:17

我尝试扩展Eric的答案,但由于任意原因而被拒绝,因此我正在编写自己的文章,以尝试为遇到此问题的其他人澄清更多内容因为我讨厌官僚主义,所以这个问题.将其添加为答案将使我能够提供一些视觉辅助工具:

I tried to expand Eric's answer but it was rejected for arbitrary reasons, so I'm writing my own to try and clarify some more for anyone else that runs into this problem since I hate bureaucracy. Adding it as an answer will allow me to provide some visual aids:

NNGINETest具有在构建中报告的错误. Eric的答案是正确的,因为我们可以将其排除在外,但是问题是,当我右键单击项目并将其标记为以这种方式发布时,控制台在构建时仍然充满错误报告.我通过File -> Settings -> Build, Execution, Deployment -> Compiler -> Excludes

NNGINETest has errors that are reported in building. Eric's answer is correct in that we can exclude it, but the problem is that the console is still spammed with error reports upon building when I right clicked the project and marked it for exluding that way. I fixed it by excluding it via the menu in File -> Settings -> Build, Execution, Deployment -> Compiler -> Excludes

您可能还需要确保选中"Recusively"复选框以查找要排除的模块.

You'll want to probably also make sure that the "Recusively" checkboxes are checked for modules you want to exclude.

我真的不知道这与使用右键单击菜单选项有什么区别(我也无法在IntelliJ手册中找到任何有关它的信息,但也许有人可以在评论中提供链接),但是这成功地阻止了NNGINETest在构建过程中乱扔控制台:

I don't really know what the difference is here between this and using the right click menu option (I couldn't find anything in the IntelliJ manual about it either but maybe someone can provide a link in the comments), but this successfully prevented NNGINETest from littering the console during building:

此外,使用排除"菜单而不是模块的目录标记可以使该模块仍然出现在项目"模块列表中,而不是消失.被排除的文件夹将出现一个"x".我认为这非常有用:

Additionally, using the Excludes menu rather than the directory marking for the module allows it to still appear in the Project module list rather than disappearing. An "x" will appear by excluded folders. This is pretty useful in my opinion:

希望这会有所帮助!