How to use findbugs in Apache Hadoop project
Detect findbugs warnings
$ mvn clean
$ mvn install -DskipTests
$ mvn findbugs:findbugs
You can see the following message if there are some findbugs warnings
[INFO] ------------------------------------------------------------------------
[INFO] Building Apache Hadoop Data Join 3.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- findbugs-maven-plugin:3.0.0:findbugs (default-cli) @ hadoop-datajoin ---
[INFO] Fork Value is true
[java] Picked up _JAVA_OPTIONS: -Dfile.encoding=UTF-8
[java] Warnings generated: 2
[INFO] Done FindBugs Analysis....
View the warnings via GUI
If there are findbugs warnings in hadoop-datajoin module, do the following:
$ cd hadoop-tools/hadoop-datajoin
$ mvn findbugs:gui
Open a window as the above screenshot. You can easily detect the code which causes findbugs warnings.
Output HTML
When
findbugs:findbugs
is executed, the output is XML. It is difficult to know what the warnings are by reading the XML file. Nothing to worry about, we can easily convert the XML file to HTML so that we can know what Unlike gui, we can attach the file in JIRA to share the problem.Prequisites: findbugs is installed and
$FINDBUGS_HOME
is set appropriately.$ $FINDBUGS_HOME/bin/convertXmlToText -html target/findbugsXml.xml target/findbugsHtml.html
Summary
findbugs:gui
is very useful.
Reference
이 문제에 관하여(How to use findbugs in Apache Hadoop project), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/ajis_ka_old/items/877be5edafa770485978텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)