SCA和Gradle包装器集成

时间:2018-08-16 20:53:46

标签: gradle fortify sourceanalyser

提到我可以使用

在文档上使用gradle与SCA
sourceanalyzer -b build gradle clean build

但是我正在尝试使用包装器,但是我不断收到sourceanalyzer error = 2 ...

>>>>>>>sourceanalyzer -b buildxyz ./gradlew clean build
starting init script
TaskListener registered.
Configuration on demand is an incubating feature.
> Task :clean


FAILURE: Build failed with an exception.

* Where:
Initialization script '/Users/.../.fortify/sca17.2/build/buildxyz/init-script4841163810233991317.gradle' line: 203

* What went wrong:
java.io.IOException: Cannot run program "sourceanalyzer": error=2, No such file or directory
> Cannot run program "sourceanalyzer": error=2, No such file or directory

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.8.1/userguide/command_line_interface.html#sec:command_line_warnings

即使只是使用gradle,我也会遇到另一个错误...

>>>>>>>sourceanalyzer -b buildxyz gradle clean build
[warning]: File clean not found

2 个答案:

答案 0 :(得分:0)

我在Fortify和gradle中使用了三个步骤:

  1. 清洁

    sourceanalyzer -b ${SEC_REPORT_NAME} -verbose -clean

  2. 构建

    sourceanalyzer -b ${SEC_REPORT_NAME} -gradle -verbose gradle -Dorg.gradle.java.home=/opt/jdk8 ${SEC_BUILD_TARGETS}
  3. 扫描

    sourceanalyzer -b ${SEC_REPORT_NAME} -verbose -scan -f ${SEC_TARGET}/${SEC_REPORT_NAME}.fpr

其中${SEC_REPORT_NAME}是应用程序报告ID-每个步骤都应相同 ${SEC_BUILD_TARGETS}是gradle的标准构建目标(“干净构建”) ${SEC_TARGET}是输出目录

答案 1 :(得分:0)

似乎'sourceanalyzer'不在路径中,因为根据以下消息无法在系统上找到它:

  • 出了什么问题: java.io.IOException:无法运行程序“ sourceanalyzer”:error = 2,没有这样的文件或目录
      

    无法运行程序“ sourceanalyzer”:error = 2,没有这样的文件或目录

确保将sourceanalyzer安装在本地和路径中。