【问题标题】:How to solve Matching configurations not found?如何解决找不到匹配的配置?
【发布时间】:2022-01-25 22:20:48
【问题描述】:

更新到 gradle 7.3.2 后,我遇到了这个问题:

  • 出了什么问题: 任务“:bps-ips-bridge-core:snykResolvedDepsJson”执行失败。

找不到匹配的配置:^(runtimeOnly|implementation)$,项目项目':myProject'的可用配置:[annotationProcessor, api, apiElements, archives, bootArchives, checkstyle, compileClasspath, compileOnly, compileOnlyApi, default, developmentOnly, implementation 、jacocoAgent、jacocoAnt、productionRuntimeClasspath、provided、providedCompile、providedRuntime、runtimeClasspath、runtimeElements、runtimeOnly、签名、testAnnotationProcessor、testCompileClasspath、testCompileOnly、testImplementation、testRuntimeClasspath、testRuntimeOnly]

这是 Jenkinsfile 中的 snyk 阶段的样子:

 stage('Snyk Checking') {
            steps {
                sh 'echo test snyk'
                snykSecurity(snykInstallation: 'snyk', snykTokenId: 'snyk-api-token', failOnIssues: true, severity: 'high', targetFile: 'my-project/build.gradle', additionalArguments: '--configuration-matching=^(runtimeOnly|implementation)$')
            }
        }

以前更新gradle之前是这样的: --configuration-matching=^(运行时|编译)

问题是什么以及如何解决?

【问题讨论】:

    标签: gradle snyk


    【解决方案1】:

    Snyk 不需要额外的参数。这部分可以删除:

    additionalArguments: '--configuration-matching=^(runtimeOnly|implementation)$'
    

    【讨论】:

      猜你喜欢
      • 2021-11-30
      • 1970-01-01
      • 2023-03-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-28
      相关资源
      最近更新 更多