In advance, I really feel stupid for asking this…
Im trying to apply the dependency checker plugin though init-script and for the life of me I cannot figure out where I go wrong. I feel 90% sure that I have a typo somewhere.
Here is what I have attempted so far:
initscript {
repositories {
maven { url "https://<internal>" }
}
dependencies {
classpath "org.owasp:dependency-check-gradle:8.2.1"
}
}
rootProject {
apply(plugin = "org.owasp.dependencycheck") <-- this is koltlin syntax so that does not work
}
This fails with error:
Could not set unknown property ‘plugin’ for root project ‘<>’ of type org.gradle.api.Project.
So I tested various combos of “apply plugin”:
apply plugin: org.owasp.dependencycheck.DependencyCheckPlugin
result: Could not get unknown property ‘org’ for root project ‘<>’ of type org.gradle.api.Project.
And:
apply plugin: 'org.owasp.dependencycheck'
Plugin with id ‘org.owasp.dependencycheck’ not found.
I do a very similar thing for sonarqube and that works, and adding a buildscript block in a single project works. That buildscript looks like:
buildscript {
repositories {
maven { url artifactory_url+"/all-libs" }
}
dependencies {
classpath 'org.owasp:dependency-check-gradle:8.2.1'
}
}
apply plugin: 'org.owasp.dependencycheck'
I stared at this for too long now and Im hoping that a fresh pair of eyes will see a really stupid mistake