sijie closed pull request #834: Issue 741: Switch to Spotbugs
URL: https://github.com/apache/bookkeeper/pull/834
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 566e18fb0..6a0d6a6dd 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -22,7 +22,7 @@ Master Issue: #<master-issue-number>
> `<Issue # or BOOKKEEPER-#>: Description of pull request`
> `e.g. Issue 123: Description ...`
> `e.g. BOOKKEEPER-1234: Description ...`
-> - [ ] Make sure tests pass via `mvn clean apache-rat:check install
findbugs:check`.
+> - [ ] Make sure tests pass via `mvn clean apache-rat:check install
spotbugs:check`.
> - [ ] Replace `<Issue # or BOOKKEEPER-#>` in the title with the actual
> Issue/JIRA number.
>
> ---
diff --git a/.travis.yml b/.travis.yml
index bea17d538..bd39e3e17 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -34,7 +34,7 @@ before_install:
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then jdk_switcher use "$CUSTOM_JDK";
fi
script:
- - travis_retry mvn --batch-mode clean apache-rat:check compile findbugs:check
+ - travis_retry mvn --batch-mode clean apache-rat:check compile spotbugs:check
# Disabled the tests here. Since tests are running much slower on Travis than
on Jenkins
# - ./dev/ticktoc.sh "mvn --batch-mode clean package"
diff --git a/bookkeeper-common/pom.xml b/bookkeeper-common/pom.xml
index b1c624e6b..2b3a7b964 100644
--- a/bookkeeper-common/pom.xml
+++ b/bookkeeper-common/pom.xml
@@ -56,8 +56,8 @@
<build>
<plugins>
<plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>findbugs-maven-plugin</artifactId>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
diff --git a/bookkeeper-server/pom.xml b/bookkeeper-server/pom.xml
index 28d90ba0e..a772b3fc3 100644
--- a/bookkeeper-server/pom.xml
+++ b/bookkeeper-server/pom.xml
@@ -287,8 +287,8 @@
</configuration>
</plugin>
<plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>findbugs-maven-plugin</artifactId>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
diff --git a/dev/bk-merge-pr.py b/dev/bk-merge-pr.py
index 8ba0c48e0..7ef97da9b 100755
--- a/dev/bk-merge-pr.py
+++ b/dev/bk-merge-pr.py
@@ -174,10 +174,10 @@ def merge_pr(pr_num, target_ref, title, body,
default_pr_reviewers, pr_repo_desc
else:
continue_maybe("Unit tests execution FAILED. Do you want to
continue with the merge anyway?")
- # Offer to run findbugs and rat before committing
- result = raw_input('Do you want to validate findbugs and rat after the
merge? (y/n): ')
+ # Offer to run spotbugs and rat before committing
+ result = raw_input('Do you want to validate spotbugs and rat after the
merge? (y/n): ')
if result.lower() == 'y':
- test_res = subprocess.call('mvn clean install -DskipTests
findbugs:check apache-rat:check'.split())
+ test_res = subprocess.call('mvn clean install -DskipTests
spotbugs:check apache-rat:check'.split())
if test_res == 0:
print('QA tests execution succeeded')
else:
diff --git a/dev/docker/ci.sh b/dev/docker/ci.sh
index faacea351..75588a3d3 100755
--- a/dev/docker/ci.sh
+++ b/dev/docker/ci.sh
@@ -58,7 +58,7 @@ docker run \
-v "${LOCAL_HOME}:/home/${USER_NAME}" \
-e MAVEN_OPTS='-Xmx4g -Xms2g' \
${IMAGE_NAME}-${USER_NAME} \
- bash -c "mvn clean apache-rat:check package findbugs:check"
+ bash -c "mvn clean apache-rat:check package spotbugs:check"
popd
diff --git a/jenkins/bookkeeper-master-job-configuration.yaml
b/jenkins/bookkeeper-master-job-configuration.yaml
index ec83cbd33..f79439a98 100644
--- a/jenkins/bookkeeper-master-job-configuration.yaml
+++ b/jenkins/bookkeeper-master-job-configuration.yaml
@@ -31,7 +31,7 @@
node: Hadoop
maven:
root-pom: pom.xml
- goals: clean apache-rat:check package findbugs:check
-Dmaven.test.failure.ignore=false deploy
+ goals: clean apache-rat:check package spotbugs:check
-Dmaven.test.failure.ignore=false deploy
incremental-build: true
reporters:
- email:
@@ -57,4 +57,4 @@
option: project
- rebuild:
auto-rebuild: false
- rebuild-disabled: false
\ No newline at end of file
+ rebuild-disabled: false
diff --git a/pom.xml b/pom.xml
index 7f1d2c373..6f50d55de 100644
--- a/pom.xml
+++ b/pom.xml
@@ -115,7 +115,7 @@
<zookeeper.version>3.5.3-beta</zookeeper.version>
<findbugs-jsr305.version>3.0.0</findbugs-jsr305.version>
<!-- plugin dependencies -->
- <findbugs-maven-plugin.version>3.0.5</findbugs-maven-plugin.version>
+ <spotbugs-maven-plugin.version>3.1.0-RC6</spotbugs-maven-plugin.version>
<puppycrawl.checkstyle.version>6.19</puppycrawl.checkstyle.version>
<maven-checkstyle-plugin.version>2.17</maven-checkstyle-plugin.version>
<maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
@@ -197,9 +197,9 @@
</extensions>
<plugins>
<plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>findbugs-maven-plugin</artifactId>
- <version>${findbugs-maven-plugin.version}</version>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
+ <version>${spotbugs-maven-plugin.version}</version>
<configuration>
<excludeFilterFile>${session.executionRootDirectory}/buildtools/src/main/resources/bookkeeper/findbugsExclude.xml</excludeFilterFile>
</configuration>
diff --git a/site/docs/latest/getting-started/installation.md
b/site/docs/latest/getting-started/installation.md
index fac16ddd3..9986cd8e0 100644
--- a/site/docs/latest/getting-started/installation.md
+++ b/site/docs/latest/getting-started/installation.md
@@ -54,7 +54,7 @@ Command | Action
:-------|:------
`mvn clean` | Removes build artifacts
`mvn compile` | Compiles JAR files from Java sources
-`mvn compile findbugs:findbugs` | Compile using the Maven
[FindBugs](http://gleclaire.github.io/findbugs-maven-plugin) plugin
+`mvn compile spotbugs:spotbugs` | Compile using the Maven
[SpotBugs](https://github.com/spotbugs/spotbugs-maven-plugin) plugin
`mvn install` | Install the BookKeeper JAR locally in your local Maven cache
(usually in the `~/.m2` directory)
`mvn deploy` | Deploy the BookKeeper JAR to the Maven repo (if you have the
proper credentials)
`mvn verify` | Performs a wide variety of verification and validation tasks
diff --git a/tests/backward/pom.xml b/tests/backward/pom.xml
index a84867b59..ab14cad54 100644
--- a/tests/backward/pom.xml
+++ b/tests/backward/pom.xml
@@ -108,8 +108,8 @@
<build>
<plugins>
<plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>findbugs-maven-plugin</artifactId>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services