Skip to content

DominikZig/infer-maven-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maven Central CI Qodana Code Quality Analysis

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:

  • Java 21+
  • Maven 3.8.6+
  • Linux, MacOS (ARM based)

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)
extraArgs A list of additional Infer CLI arguments. See Infer Manuals for available options.
customArgs A list of custom Infer CLI arguments to override the default ones. See Infer Manuals for available options.

About

Maven plugin for the Infer Static Analyzer

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages