-
Notifications
You must be signed in to change notification settings - Fork 5
deadcode4j v1.5: 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:1.5: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.
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.
This goal is deprecated. It is replaced by de.is24.mavenplugins:deadcode4j-maven-plugin:find-only
which has a shorter name.