Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven: Report using deprecated classes / methods

I want to know if there is any kind of report on maven that show's me the classes and methods that I'm using that is deprecated.

like image 495
endrigoantonini Avatar asked Jul 04 '12 14:07

endrigoantonini


2 Answers

Normally you see deprecation warnings in the IDE, but you can also add showDeprecation parameter to the Maven compiler plugin section. Then those warnings will be shown in the log.

<plugin>
     <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-compiler-plugin</artifactId>
     <version>3.1</version>
     <configuration>
         <showDeprecation>true</showDeprecation>
     </configuration>
 </plugin>

Then you can generate build report from that javac output using reporting plugins on CI server. For example Jenkins Warning Plugin.

like image 87
Eugene Kuleshov Avatar answered Nov 08 '22 17:11

Eugene Kuleshov


Sonar includes an engine called squid, which according to an article I found, locates and reports on usage of deprecated methods. I haven't used Sonar yet (it's on my list of things to learn) but teammates of mine like it a lot.

like image 37
user944849 Avatar answered Nov 08 '22 18:11

user944849