提交 13b64481 编写于 作者: oldratlee's avatar oldratlee 🔥

add spotbugs lint, CI should FAIL.

- add spotbugs-maven-plugin
- use spotbugs-annotations instead of jsr305
上级 b697c9e2
......@@ -88,6 +88,7 @@
<kotlin.version>1.3.41</kotlin.version>
<kotlin.coroutine.version>1.2.2</kotlin.coroutine.version>
<spotbugs.version>3.1.12</spotbugs.version>
</properties>
<dependencies>
......@@ -101,10 +102,16 @@
<version>3.23.2-GA</version>
<optional>true</optional>
</dependency>
<!--
JSR305 is already Dormant status, so SpotBugs does not release jsr305 jar file.
Please continue using findbugs’ one.
depend on spotbugs-annotations instead.
https://spotbugs.readthedocs.io/en/stable/migration.html
-->
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-annotations</artifactId>
<version>${spotbugs.version}</version>
<optional>true</optional>
</dependency>
<!-- Testing frameworks and related dependencies -->
......@@ -290,6 +297,16 @@
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<!--
https://spotbugs.github.io/
https://spotbugs.readthedocs.io/en/latest/introduction.html
https://spotbugs.readthedocs.io/en/latest/maven.html
-->
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>${spotbugs.version}</version>
</plugin>
<!--
official docs: https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html
......@@ -481,6 +498,31 @@
</plugins>
</build>
</profile>
<profile>
<id>lint</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<executions>
<execution>
<phase>test-compile</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>gen-git-properties</id>
<activation>
......@@ -495,6 +537,9 @@
Maven plugin which includes build-time git repository information into an POJO / *.properties).
Make your apps tell you which version exactly they were built from! Priceless in large distributed deployments.
https://github.com/ktoso/maven-git-commit-id-plugin
Spotbugs support @SuppressWarnings
https://github.com/spotbugs/spotbugs/issues/737#issuecomment-416118033
-->
<plugin>
<groupId>pl.project13.maven</groupId>
......
......@@ -88,6 +88,7 @@
<kotlin.version>1.3.41</kotlin.version>
<kotlin.coroutine.version>1.2.2</kotlin.coroutine.version>
<spotbugs.version>3.1.12</spotbugs.version>
</properties>
<dependencies>
......@@ -101,10 +102,16 @@
<version>3.23.2-GA</version>
<optional>true</optional>
</dependency>
<!--
JSR305 is already Dormant status, so SpotBugs does not release jsr305 jar file.
Please continue using findbugs’ one.
depend on spotbugs-annotations instead.
https://spotbugs.readthedocs.io/en/stable/migration.html
-->
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-annotations</artifactId>
<version>${spotbugs.version}</version>
<optional>true</optional>
</dependency>
<!-- Testing frameworks and related dependencies -->
......@@ -290,6 +297,16 @@
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<!--
https://spotbugs.github.io/
https://spotbugs.readthedocs.io/en/latest/introduction.html
https://spotbugs.readthedocs.io/en/latest/maven.html
-->
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>${spotbugs.version}</version>
</plugin>
<!--
official docs: https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html
......@@ -481,6 +498,31 @@
</plugins>
</build>
</profile>
<profile>
<id>lint</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<executions>
<execution>
<phase>test-compile</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>gen-git-properties</id>
<activation>
......@@ -495,6 +537,9 @@
Maven plugin which includes build-time git repository information into an POJO / *.properties).
Make your apps tell you which version exactly they were built from! Priceless in large distributed deployments.
https://github.com/ktoso/maven-git-commit-id-plugin
Spotbugs support @SuppressWarnings
https://github.com/spotbugs/spotbugs/issues/737#issuecomment-416118033
-->
<plugin>
<groupId>pl.project13.maven</groupId>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册