-
Notifications
You must be signed in to change notification settings - Fork 5
deadcode4j v2.1.0: Usage
deadcode4j provides the following goals:
Simply run mvn de.is24.mavenplugins:deadcode4j-maven-plugin:find -Dmaven.test.skip=true
in the project you want to analyze.
deadcode4j will trigger the package phase to be executed for a project (and for all modules listed in a reactor project) before analyzing the output directories.
The output will look something like this:
[INFO] --- deadcode4j-maven-plugin:2.1.0:find (default-cli) @ someProject ---
[INFO] Analyzed 42 class(es).
[WARNING] Found 3 unused class(es):
[WARNING] de.is24.deadcode4j.Foo
[WARNING] de.is24.deadcode4j.Bar
[WARNING] de.is24.deadcode4j.SomeAnnotatedClass
The -Dmaven.test.skip=true
part skips compiling & executing tests, as they are not relevant for the analysis. Likewise, you may add -Dinvoker.skip=true
if you're using the invoker plugin.
If not configured otherwise, deadcode4j will request your permission to send some usage statistics. Use Maven's -B
parameter to prevent user interaction.
Using Maven's -o
parameter will skip sending usage statistics and checking for updates - even if configured otherwise.
This goal can be adapted to your needs.
As an alternative, you can run mvn de.is24.mavenplugins:deadcode4j-maven-plugin:find-only
which performs the same analysis, but without triggering the package phase. This is intended for repeated analysis (e.g. after updating the configuration) or if your project is already packaged.
This goal supports the same configuration as find
.
Lists the available goals & parameters.