如何解决找不到匹配的配置?

How to solve Matching configurations not found?

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

Matching configurations not found: ^(runtimeOnly|implementation)$, available configurations for project project ':myProject': [annotationProcessor, api, apiElements, archives, bootArchives, checkstyle, compileClasspath, compileOnly, compileOnlyApi, default, developmentOnly, implementation, jacocoAgent, jacocoAnt, productionRuntimeClasspath, provided, providedCompile, providedRuntime, runtimeClasspath, runtimeElements, runtimeOnly, signatures, 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=^(运行时|编译)

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

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

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