小编Tec*_*ops的帖子

使用Gradle进行HP Fortify扫描

我在build.gradle中使用以下配置来运行HP Fortify扫描:

// Fortify configuration
configurations {
  fortify { extendsFrom compile }
}

// pull in the fortify libs for the new configuration
dependencies {
  fortify 'com.fortify:sourceanalyzer:3.90'
}

task fortifyReport(dependsOn: compileJava) << {
  ant.properties['build.compiler']='com.fortify.dev.ant.SCACompiler'
  ant.typedef(name: 'sca', classname: 'com.fortify.dev.ant.SourceanalyzerTask', classpath: configurations.fortify.asPath)
  ant.sca(jdk:"1.7",
    debug:true ,
    verbose:true ,
    failonerror:true ,
    scan:true ,
    logFile:file("$buildDir/reports/fortify/Fortify.log"),
    resultsFile:file("$buildDir/reports/fortify/${project.name}.fpr")
  ){
    fileset(dir:'src/main') {
      include(name:'**/*.java')
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

但在执行时,我得到以下内容:

* What went wrong:
Execution failed for task ':fortifyReport'.
> Could not resolve all dependencies for configuration 'detachedConfiguration157'.
> Could not …
Run Code Online (Sandbox Code Playgroud)

sca gradle fortify build.gradle fortify-source

3
推荐指数
1
解决办法
5418
查看次数

标签 统计

build.gradle ×1

fortify ×1

fortify-source ×1

gradle ×1

sca ×1