Can I specify Java alert options for each project in Eclipse?

I have a Java project, which is a combination of human-written Java code and Java code created by an axis.

The axis-generated code generates thousands of warnings from the Java compiler (either javac or the built-in Eclipse). Examples of warnings: dead code, the use of raw lists and array types preceding Java generics, etc. (More at http://www.coderanch.com/t/501752/Web-Services/java/Axis-Generate-without-Warnings ). I would like to shut up and ignore these specific warnings in the generated code, but not in human code.

I saw How to add the -Xlint: unchecked option or any javac option in Eclipse? , and this allows me to turn off the corresponding warnings through Window-> Preferences, but the workspace, which is not what I want. Is there a way to do this based on each project?

If not, how do people deal with generated code without ignoring warnings that would be helpful to people?

+3
source share
3 answers

You can enable many different options for each project. Assuming you are using Helios, here's how to set up alerts for a specific project:

  • Right-click the project (or select the project, then Alt+ Enter)
  • Java Compiler → Errors / Warnings
  • " " ( , ?) )
  • !

illustrious illustration!

+8

, Matt, ( )

, :

" ".

+3

. , , , . , . :

  • wsdl2java , .

  • .

  • . zip.

  • .

Once you do this, add the jar to your class path, then edit the assembly configuration and add the zipfile as the "source application". Eclipse will show you the correct source when navigating to one of the generated classes, but it will not parse the code for warnings. The jar with the generated code in it can be added to your packaged service; with the AAR package, it goes into a subdirectory called "lib".

0
source

Source: https://habr.com/ru/post/1788576/


All Articles