Please download the runnable.jar.
Make sure that your java path points to a JDK (version >= 8).
You can pass several path arguments to the jar, including directories and .java files. Make sure to provide full paths.
java -jar spongebugs-runner-2.0.0.jar /tmp/project/path/src
java -jar spongebugs-runner-2.0.0.jar /tmp/project/path/src/main/java/Main.java --rules=C8,C9 --ignoreTestFiles=false
java -jar spongebugs-runner-2.0.0.jar /tmp/project1/path /tmp/project2/path /tmp/project3/path/src/main/java/Main.java --rules=B1,B2
--ignoreTestFiles=true
(default)
--ignoreTestFiles=false
You can either include some rules, or exclude rules. You cannot have both.
Use ,
as a separator if you want more than one rule, with no spaces in between.
See the Rules section for more details on each rule.
Running only with rules C1 and C5:
java -jar spongebugs-runner-2.0.0.jar project/path/src --rules=C1,C5
Running all rules expect B1:
java -jar spongebugs-runner-2.0.0.jar project/path/src --excludeRules=B1
Please note that Rules B2 and C6 were implemented together, therefore if you want to include/exclude one, you impact the other one as well.