IntelliJ: Disable warnings/errors for a single module

Brasch :

I've recently migrated to IntelliJ and need to solve a particular problem: I have a project that has numerous modules; one of these modules is purely for testing and contains a number of errors:

enter image description here.

I'd like to suppress all warnings/errors/inspections on NNGINETest in this screenshot. Is there a way to configure the project to do that? I found this answer: How do I disable some inspections for modules in IntelliJ IDEA? but I'm not quite sure it's for the same thing. On top of that, the answer was a bit unclear to me and I wasn't able to understand all of the steps because of how new and unfamiliar with IntelliJ that I am.

If someone could please thoroughly explain to me how to solve this problem, I would be grateful.

Brasch :

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 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

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

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:

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:

Hope this helps!

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=156872&siteId=1