FindBugs 3.0 から SpotBugs 3.1 への移行ガイド

com.google.code.findbugs:findbugs

com.google.code.findbugs:findbugscom.github.spotbugs:spotbugs に換えてください。

<!-- for Maven -->
<dependency>
  <groupId>com.github.spotbugs</groupId>
  <artifactId>spotbugs</artifactId>
  <version>3.1.0-RC7</version>
</dependency>
// for Gradle
compile 'com.github.spotbugs:spotbugs:3.1.0-RC7'

com.google.code.findbugs:jsr305

JSR305 は,すでに休止状態なので,SpotBugs は jsr305 jarファイルをリリースしません。FindBugs のものを使い続けてください。

com.google.code.findbugs:findbugs-annotations

代わりに spotbugs-annotations に依存してください。

<!-- for Maven -->
<dependency>
  <groupId>com.github.spotbugs</groupId>
  <artifactId>spotbugs-annotations</artifactId>
  <version>3.1.0-RC7</version>
  <optional>true</optional>
</dependency>
// for Gradle
compileOnly 'com.github.spotbugs:spotbugs-annotations:3.1.0-RC7'

com.google.code.findbugs:annotations

Please depend on both of spotbugs-annotations and net.jcip:jcip-annotations:1.0 instead.

<!-- for Maven -->
<dependency>
  <groupId>net.jcip</groupId>
  <artifactId>jcip-annotations</artifactId>
  <version>1.0</version>
  <optional>true</optional>
</dependency>
<dependency>
  <groupId>com.github.spotbugs</groupId>
  <artifactId>spotbugs-annotations</artifactId>
  <version>3.1.0-RC7</version>
  <optional>true</optional>
</dependency>
// for Gradle
compileOnly 'net.jcip:jcip-annotations:1.0'
compileOnly 'com.github.spotbugs:spotbugs-annotations:3.1.0-RC7'

FindBugs Ant タスク

findbugs-ant.jarspotbugs-ant.jar に換えてください。

<taskdef
  resource="edu/umd/cs/findbugs/anttask/tasks.properties"
  classpath="path/to/spotbugs-ant.jar" />
<property name="spotbugs.home" value="/path/to/spotbugs/home" />

<target name="spotbugs" depends="jar">
  <spotbugs home="${spotbugs.home}"
            output="xml"
            outputFile="bcel-fb.xml" >
    <auxClasspath path="${basedir}/lib/Regex.jar" />
    <sourcePath path="${basedir}/src/java" />
    <class location="${basedir}/bin/bcel.jar" />
  </spotbugs>
</target>

FindBugs Maven プラグイン

org.codehaus.mojo:findbugs-maven-plugin の代わりに com.github.spotbugs:spotbugs-maven-plugin を使用してください。

<plugin>
  <groupId>com.github.spotbugs</groupId>
  <artifactId>spotbugs-maven-plugin</artifactId>
  <version>3.1.0-RC6</version>
  <dependencies>
    <!-- overwrite dependency on spotbugs if you want to specify the version of spotbugs -->
    <dependency>
      <groupId>com.github.spotbugs</groupId>
      <artifactId>spotbugs</artifactId>
      <version>3.1.0-RC7</version>
    </dependency>
  </dependencies>
</plugin>

FindBugs Gradle プラグイン

https://plugins.gradle.org/plugin/com.github.spotbugs にある spotbugs プラグインを使用してください。

plugins {
  id  'com.github.spotbugs' version '1.5'
}
spotbugs {
  toolVersion = '3.1.0-RC7'
}

// To generate an HTML report instead of XML
tasks.withType(com.github.spotbugs.SpotBugsTask) {
  reports {
    xml.enabled = false
    html.enabled = true
  }
}

FindBugs Eclipse プラグイン

代わりに次の更新サイトをご利用ください。