6

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

Some remarks:

  • I cannot change the code, it's a pattern widely used by Jenkins.
  • It seems the Java Language Specification (JLS) allows it - anyway javac doesn't mark it as error.
  • The reason for the warning is that a class and a resource folder have the same name (I am not sure if a resource folder establishes a package according to JLS).
  • I want to get that warning away because it hides other warnings.
Community
  • 1
  • 1
Gustave
  • 3,359
  • 4
  • 31
  • 64
  • which version of Eclipse and Jenikns are you using? – Jordi Castilla Aug 07 '15 at 08:11
  • Since it is a warning in Eclipse you can check the settings to disable it. Should be somewhere in a "Inspections" menu (don't the real name of it since I don't use Eclipse). – Tom Aug 07 '15 at 08:17
  • Eclipse: Version: Luna Service Release 1 (4.4.1) Build id: 20140925-1800, Jenkins: current master (but that's not relevant, you can reproduce it with a simple example) – Gustave Aug 07 '15 at 08:18
  • The warning is not listed under Java/Compiler/"Errors/Warnings" (or at least I am not able to find it there). – Gustave Aug 07 '15 at 08:22

2 Answers2

7

Unfortunately it's not currently possible to disable that warning in Eclipse. There is an open feature request to make it possible, however it has had no action since 2012.

Boann
  • 48,794
  • 16
  • 117
  • 146
-1

For Jenkins plugins, since there are no resources to compile in src/main/resources, in Eclipse, I toggled the 'Ignore optional compile problems' to Yes. That will remove the warning.