File tree Expand file tree Collapse file tree
main/java/uk/gov/hmcts/tools Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929
3030public final class DependencyCheckSetup {
3131
32+ private static final String PRODUCTION_RUNTIME_CLASSPATH = "productionRuntimeClasspath" ;
33+
3234 private DependencyCheckSetup () {
3335 }
3436
@@ -69,7 +71,7 @@ public static void apply(Project project) {
6971
7072 // Scan only runtime configurations by default.
7173 // This can be overridden in project build script if desired.
72- extension .getScanConfigurations ().add ("runtimeClasspath" );
74+ extension .getScanConfigurations ().add (PRODUCTION_RUNTIME_CLASSPATH );
7375
7476 extension .getFormats ().add (Format .XML .name ());
7577 Task cleaner = project .getTasks ().create ("cleanSuppressions" );
Original file line number Diff line number Diff line change 11package uk.gov.hmcts
22
3+ import org.gradle.testfixtures.ProjectBuilder
4+ import org.owasp.dependencycheck.gradle.extension.DependencyCheckExtension
35import spock.lang.Specification
6+ import uk.gov.hmcts.JavaPlugin
47import uk.gov.hmcts.tools.DependencyCheckSetup
58
69class Test extends Specification {
710
11+ def " configures dependency check to scan production runtime classpath" () {
12+ given :
13+ def project = ProjectBuilder . builder(). build()
14+
15+ when :
16+ project. plugins. apply(JavaPlugin )
17+ def extension = project. extensions. getByType(DependencyCheckExtension )
18+
19+ then :
20+ extension. scanConfigurations. get() == [" productionRuntimeClasspath" ]
21+ extension. skipTestGroups. get()
22+ }
23+
824 def " extracts set of CVEs from suppression report" () {
925 given :
1026 def xml = this . getClass(). getResource(' /dependency_checker_report_for_redundant_suppressions.xml' ). text
You can’t perform that action at this time.
0 commit comments