Is there any way to suppress "Type (...) is faced with a package warning in Eclipse?

This question is closely related to java-class-name-same-as-the-nested-package-name . My specific question is here: how can I disable or suppress this warning in Eclipse?

Some notes:

  • I can’t change the code, this is a template widely used by Jenkins.
  • The Java Language Specification (JLS) seems to allow this - somehow javac does not put it as an error.
  • The reason for the warning is that the class and the resource folder have the same name (I'm not sure if the resource folder installs the package in accordance with JLS).
  • I want to receive this warning because it hides other warnings.
+4
source share
2 answers

Unfortunately, it is currently not possible to disable this warning in Eclipse. There is an open function request to make this possible , however it has not been operational since 2012.

+5
source

For Jenkins plugins, since there are no compilation resources in src / main / resources, in Eclipse I switched “ignore optional compilation problems” to “Yes”. This will clear the warning.

-one
source

All Articles