How do I use a class in my build.gradle script, which I’ve included as a dependency?
I need to call a library function to decrypt a password. I have this library checked into my project under a subdirectory, like so:
project/
build.gradle
build_lib/
bar-1.1.jar
build.gradle
import com.example.foo.FooBar
buildscript {
repositories {
mavenLocal()
flatDir name: 'build_lib', dirs: System.getProperty("user.dir") + '/build_lib'
maven{
url = "http://dc1artifctry01:8081/artifactory/releases"
credentials {
username System.getProperty('user.name')
password FooBar.getThePassword()
}
}
}
dependencies {
classpath "com.example.foo:bar:1.1"
}
}
However, when I run the build, I get this error:
Error initializing classpath: No such property: FooBar for class: org.gradle.api.internal.artifacts.repositories.DefaultPasswordCredentials_Decorated