Maven Plugin

Maven Central Version

For detailed configuration and usage, see the plugin docs.

Simple Demo

Maven Demo

Basic Usage

<plugin>
<groupId>com.optum.sourcehawk.maven</groupId>
<artifactId>sourcehawk-maven-plugin</artifactId>
<executions>
<execution>
<id>scan</id>
<goals>
<goal>scan</goal>
</goals>
</execution>
</executions>
</plugin>

From the command line

mvn sourcehawk:scan

Skip Scan

Use the skipScan configuration property to skip the scan if necessary

<plugin>
<groupId>com.optum.sourcehawk.maven</groupId>
<artifactId>sourcehawk-maven-plugin</artifactId>
<executions>
<execution>
<id>scan</id>
<goals>
<goal>scan</goal>
</goals>
<configuration>
<skipScan>true</skipScan>
</configuration>
</execution>
</executions>
</plugin>

From the command line

mvn sourcehawk:scan -Dsourcehawk.skipScan

Prevent Build from Failing

Set the failBuild property to false to prevent the build from failing even if the scan fails.

<plugin>
<groupId>com.optum.sourcehawk.maven</groupId>
<artifactId>sourcehawk-maven-plugin</artifactId>
<executions>
<execution>
<id>scan</id>
<goals>
<goal>scan</goal>
</goals>
<configuration>
<failBuild>false</failBuild>
</configuration>
</execution>
</executions>
</plugin>

From the command line

mvn sourcehawk:scan -Dsourcehawk.failBuild=false

Custom Configuration File

Override the default configuration file name with the configurationFile property.

<plugin>
<groupId>com.optum.sourcehawk.maven</groupId>
<artifactId>sourcehawk-maven-plugin</artifactId>
<executions>
<execution>
<id>scan</id>
<goals>
<goal>scan</goal>
</goals>
</execution>
</executions>
<configuration>
<configurationFile>Sourcehawk</configurationFile>
</configuration>
</plugin>

From the command line

mvn sourcehawk:scan -Dsourcehawk.configurationFile=Sourcehawk