To perform static analysis on your code:
- Ensure that the Jtest Plugin for Maven is set up (see Configuring the Jtest Plugin for Maven).
Execute the jtest:jtest goal. Your command line may resemble the following:
mvn jtest:jtest
The Jtest Plugin for Maven will collect the necessary build data in the .json file, and analyze your code depending on the configuration you provided (see Configuring Jtest Execution).
Review the analysis results (see Reviewing Results).
By default, test sources are excluded from analysis. To analyze the test code, enable the
includeTestSourcescommand line option; see Modifying the Scope with the jtest.includeTestSources Option.If your build is extended by plugins which affect the analyzed scope (for example, by appending or modifying resource files in the generate-resources phase), you can either execute all those phases so that Jtest can collect complete project data or simply execute the test-compile phase before jtest:jtest, as below:
mvn test-compile jtest:jtest