Skip to content
Maven wrapper for detekt cli
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
.travis.settings.xml
.travis.yml
LICENSE
README.md
descriptor.json
pom.xml

README.md

Build Status codecov FOSSA Status Maven Central

Detekt Maven Plugin

A maven plugin that wraps the Detekt CLI. It supports the same parameters as the Detekt CLI.

How to use

Basic configuration

<build>
    <plugins>
        <plugin>
            <groupId>com.github.ozsie</groupId>
            <artifactId>detekt-maven-plugin</artifactId>
            <version>1.0.0-RC14</version>
            <executions>
                <execution>
                    <phase>verify</phase>
                    <goals><goal>check</goal></goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

Using the above configuration, Detekt will scan source files in ${basedir}/src and output the results in ${basedir}/detekt.

All parameters available to Detekt version 1.0.0-RC14 can be configured in the plugin.

Goals

check

Used to run detekt. All cli parameters, excluding -gc and -cb, are available using -Ddetekt.{parameter}

Examples

  • mvn detekt:check -Ddetekt.config=detekt.yml
  • mvn detekt:check -Ddetekt.debug=true

create-baseline

Used to create a baseline. All cli parameters, excluding -gc and -cb, are available using -Ddetekt.{parameter}

Examples

  • mvn detekt:cb -Ddetekt.config=detekt.yml
  • mvn detekt:cb -Ddetekt.debug=true
  • mvn detekt:create-baseline -Ddetekt.config=detekt.yml
  • mvn detekt:create-baseline -Ddetekt.debug=true

generate-config

Used to generate a default configuration file

Example

  • mvn detekt:gc
  • mvn detekt:generate-config

For more information on Detekt, have a look at https://github.com/arturbosch/detekt

License

FOSSA Status

You can’t perform that action at this time.