You can perform analysis and testing by executing the Jtest tasks for Gradle for the main project directory. It is not necessary to build the tested project prior to analysis unless you test a multi-module project. We recommend compiling multi-module projects before running analysis by adding the build or assemble task to your command line. Doing so enables Jtest to use artifacts from the local repository, reducing the amount of time necessary to test and analyze code.
In addition, if your project is multi-module, you must execute the tasks for the root project. As a result, Jtest will test or analyze all the subprojects. To test selected subprojects, run the Jtest tasks (jtest, jtest-agent, or affectedTests) for the root project and the Gradle test task for individual subprojects, see Collecting Coverage for Unit Tests for details.