Sonatype CLM for Maven
IntelliJ IDEA supports Maven projects natively and you can simply open
a project in the IDE by opening the pom.xml
file.
Once your project is opened and you have added the plugin configuration for Sonatype CLM for Maven from Example Configuration of Sonatype CLM for Maven, you can create a configuration to run the desired Maven command.
Select Edit Configurations from the Run menu, press the + button and select Maven to add a new configuration. Enter the command line and other desired details as displayed in Figure 8.1, “Creating a Maven Run Configuration for a CLM Evaluation in IntelliJ”
After pressing OK in the dialog the new configuration will be available in the run configuration drop down as well the Maven Projects view. You can open the view using the View menu, selecting Tools Window and pressing Maven Projects. You will see the window appear in the IDE looking similar to Figure 8.2, “Maven Projects View with the CLM Evalulation Run Configuration in IntelliJ”. It displays the run configuration selector with the green play button on the top as well as the Maven project with the CLM evaluation run configuration.
You can press the green play button beside the run configuration, or the configuration entry itself in the Maven Projects window, to start a build. The build will run in an embedded console window in the IDE as displayed in Figure 8.3, “CLM for Maven Output in the Run Console in IntelliJ”, and show all the output from the Maven build including any error messages and the link to the produced report in the Sonatype CLM server. Policy violations can be configured to result in a build failure.