summaryrefslogtreecommitdiffstats
path: root/cps-parent
diff options
context:
space:
mode:
authorClaudio David Gasparini <claudio.gasparini@pantheon.tech>2020-12-18 14:37:27 +0100
committerClaudio David Gasparini <claudio.gasparini@pantheon.tech>2021-01-11 09:16:56 +0000
commit9f93f7960c97642a79ed30b84d5127017ed9fc73 (patch)
tree628376c80ac17039ca30e507889f24e9f8124630 /cps-parent
parent5a8718b84dbd3c6fa78aa644a4695274a0a1ab5d (diff)
Introduce spotbug plugin
Issue-ID: CPS-159 Signed-off-by: Claudio David Gasparini <claudio.gasparini@pantheon.tech> Change-Id: I889b3009505421621007031fb99a43c5cd30be82
Diffstat (limited to 'cps-parent')
-rw-r--r--cps-parent/pom.xml68
1 files changed, 68 insertions, 0 deletions
diff --git a/cps-parent/pom.xml b/cps-parent/pom.xml
index 55db1a198e..1f6ae2c8c7 100644
--- a/cps-parent/pom.xml
+++ b/cps-parent/pom.xml
@@ -26,7 +26,11 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<releaseNexusPath>/content/repositories/releases/</releaseNexusPath>
<repository.name>nexus3.onap.org:10001/onap/cps-service</repository.name>
+ <spotbugs-maven-plugin.version>4.1.3</spotbugs-maven-plugin.version>
<spring-boot-maven-plugin.version>2.3.3.RELEASE</spring-boot-maven-plugin.version>
+ <spotbugs.slf4j.version>1.8.0-beta4</spotbugs.slf4j.version>
+ <spotbugs.bug-pattern.version>1.5.0</spotbugs.bug-pattern.version>
+ <spotbugs.version>4.2.0</spotbugs.version>
<swagger-codegen-maven-plugin.version>3.0.18</swagger-codegen-maven-plugin.version>
<snapshotNexusPath>/content/repositories/snapshots/</snapshotNexusPath>
<tag.version>${project.version}</tag.version>
@@ -197,6 +201,66 @@
</to>
</configuration>
</plugin>
+ <plugin>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
+ <version>${spotbugs-maven-plugin.version}</version>
+ <dependencies>
+ <dependency>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs</artifactId>
+ <version>${spotbugs.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>spotbugs</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <!-- The SpotBugs Maven plugin uses SLF4J 1.8 beta 2 -->
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>${spotbugs.slf4j.version}</version>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <plugins>
+ <plugin>
+ <groupId>jp.skypencil.findbugs.slf4j</groupId>
+ <artifactId>bug-pattern</artifactId>
+ <version>1.5.0</version>
+ </plugin>
+ </plugins>
+ <!--
+ Enables analysis which takes more memory but finds more bugs.
+ If you run out of memory, changes the value of the effort element
+ to 'Low'.
+ -->
+ <effort>Max</effort>
+ <!-- Reports all bugs (other values are medium and max) -->
+ <threshold>Low</threshold>
+ <!-- Build doesn't fail if problems are found -->
+ <failOnError>false</failOnError>
+ <!-- References the excluded rules -->
+ <excludeFilterFile>spotbugs-exclude.xml</excludeFilterFile>
+ <!-- Produces XML report -->
+ <xmlOutput>true</xmlOutput>
+ <!-- Configures the directory in which the XML report is created -->
+ <xmlOutputDirectory>${project.build.directory}/spotbugs</xmlOutputDirectory>
+ </configuration>
+ <executions>
+ <!--
+ Ensures that SpotBugs inspects source code when project is compiled.
+ -->
+ <execution>
+ <id>analyze-compile</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</pluginManagement>
<plugins>
@@ -360,6 +424,10 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
+ </plugin>
</plugins>
</build>
</project> \ No newline at end of file