Skip to content

Maven Plugin Usage

Sean Flanigan edited this page Aug 22, 2018 · 4 revisions

Note that these instructions are still in flux. They may do unnecessary work, or not work at all.

Animal Sniffer

Checks that compiled bytecode is compatible with the target runtime API (currently Java 8).

mvn -DstaticAnalysis animal-sniffer:check

Dependency Analyser

Checks for the use of transient dependencies which aren't compatible with each other.

mvn -DstaticAnalysis dependency:analyze -DexcludeFrontend

Detekt

Checks for bug patterns and code smells in Kotlin code.

cd server
mvn install -DskipTests -DskipITs -Dappserver=wildfly8 -Dgwt.compiler.skip -Dskip.yarn antrun:run@detekt

Duplicate Finder

Checks for duplicate classes appearing in multiple dependencies.

mvn -DstaticAnalysis org.basepom.maven:duplicate-finder-maven-plugin:check

Enforcer

Checks for banned dependencies, bytecode versions, extra Maven repositories.

mvn install -DskipTests -pl ':build-tools'
mvn enforcer:enforce -DstaticAnalysis -pl '!:build-tools'

FindBugs/SpotBugs

Checks for bug patterns and code smells in Java bytecode. (Use Detekt for Kotlin code.)

mvn findbugs:check -DstaticAnalysis

Restrict

With this plugin, you can restrict access from any package/class to target package/class/method inside the compiled code and the (jar/war/ear) dependencies.

See https://github.com/yamanyar/restrict-maven-plugin

mvn restrict-maven-plugin:restrict@default -Drestrict.skip=false
Clone this wiki locally