A maven plugin that wraps the Detekt CLI. It supports the same parameters as the Detekt CLI.
<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.
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