Spring Boot Integrated findbug Quick Start Demo

HBLOG
2 min readJun 25, 2024

1. What is findbug?

FindBugs is a static analysis tool that examines a class or JAR file and compares bytecode to a set of defect patterns to identify possible problems. With static analysis tools, it is possible to analyze software without actually running the program. Rather than analyzing the form or structure of a class file to determine the intent of a program, the Visitor pattern is often used to identify whether the code conforms to some fixed specification.

2. Code engineering

Purpose of the experiment

Use findbug to find problems in the program

pom.xml

Run the findbug check command in the MVN package

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>springboot-demo</artifactId>
<groupId>com.et</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>findbug</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>…

--

--