I do not think Fortify installation is required, but it is rather difficult to get the maven sca plugin without it. If you install on another computer, you can only copy the plugin, but then you would not have the Audit Workbench application for working with the generated FPR. As @Eric said, you must get it through HP and it will not work without a license.
Once you have installed this, you will add profiles to your pom.xml to accomplish sca goals:
<profile> <id>sca-clean</id> <activation> <activeByDefault>false</activeByDefault> </activation> <build> <plugins> <plugin> <groupId>com.fortify.ps.maven.plugin</groupId> <artifactId>sca-maven-plugin</artifactId> <version>4.30</version> <configuration> <jre64>true</jre64> <buildId>myproject</buildId> <toplevelArtifactId>myproject.parent</toplevelArtifactId> <skipTests>true</skipTests> </configuration> <executions> <execution> <goals> <goal>clean</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </profile> <profile> <id>sca-translate</id> <activation> <activeByDefault>false</activeByDefault> </activation> <build> <plugins> <plugin> <groupId>com.fortify.ps.maven.plugin</groupId> <artifactId>sca-maven-plugin</artifactId> <version>4.30</version> <configuration> <jre64>true</jre64> <jreStack>8M</jreStack> <maxHeap>12000M</maxHeap> <verbose>true</verbose> <buildId>myproject</buildId> <toplevelArtifactId>myproject.parent</toplevelArtifactId> <skipTests>true</skipTests> <failOnSCAError>true</failOnSCAError> </configuration> <executions> <execution> <goals> <goal>translate</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </profile> <profile> <id>sca-scan</id> <activation> <activeByDefault>false</activeByDefault> </activation> <build> <plugins> <plugin> <groupId>com.fortify.ps.maven.plugin</groupId> <artifactId>sca-maven-plugin</artifactId> <version>4.30</version> <configuration> <jre64>true</jre64> <jreStack>8M</jreStack> <maxHeap>12000M</maxHeap> <verbose>true</verbose> <buildId>myproject</buildId> <toplevelArtifactId>myproject.parent</toplevelArtifactId> <failOnSCAError>true</failOnSCAError> <upload>false</upload> <projectName>My Project Main Development</projectName> <projectVersion>${project.version}</projectVersion> </configuration> </plugin> </plugins> </build> </profile>
Run the check from the command line:
mvn -Dmaven.test.skip=true -Dfortify.sca.buildId=myproject -Dfortify.sca.toplevel.artifactId=myproject.parent com.fortify.ps.maven.plugin:sca-maven-plugin:clean
Obviously, you will need to define the buildId and artifactId names, and that will change a little depending on whether you use a parent, aggregator or nothing.
source share