infer-maven-plugin

Infer Maven Plugin

See Github for more info.

Purpose

While the Infer Static Analyzer is a very powerful static analysis tool, it is a bit clunky to use in Java projects. This Maven plugin eases the running of Infer in a Maven project, along with some sane defaults such as running most Java-related Checkers by default.

Requirements

Currently it is confirmed to work with:

The latest version of this plugin works with Infer version 1.2.0.

Usage

Add the plugin to your POM:

<plugin>
  <groupId>io.github.dominikzig</groupId>
  <artifactId>infer-maven-plugin</artifactId>
  <version>0.1.0</version>
  <executions>
    <execution>
      <goals>
        <goal>infer-plugin</goal>
      </goals>
    </execution>
  </executions>
</plugin>

The plugin is configured to run on the mvn compile lifecycle step. Simply run mvn compile and Infer will scan your project and report issues. By default, the plugin will fail the build if any issues are reported.

Configuration

Parameter Description
failOnIssue Flag to fail the Maven build if Infer reports any issues (defaults to true)
enableJavaCheckers Flag to enable the extra Java related Infer checkers - bufferoverrun, cost, loop-hoisting, biabduction (defaults to true)
resultsDir Path to set the output of the infer-out directory generated by Infer (defaults to under Maven target dir)
installDir Path to set the installation location of the Infer files themselves (defaults to under your user home Downloads dir)