问题
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.
回答1:
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.
回答2:
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.
来源:https://stackoverflow.com/questions/11331270/maven-report-using-deprecated-classes-methods