I have a composite build which includes a plugin. Eg my-project/settings.gradle
includeBuild '../plugin'
This works well and allows me to use the plugin in my project. Eg my-project/build.gradle
buildscript {
dependencies {
classpath 'com.example:plugin:1.0-SNAPSHOT'
}
}
apply plugin: 'com.example.plugin'
But, if I want to do this in a a buildSrc/build.gradle
it stops being able to find the artifact from the composite. Eg my-project/buildSrc/build.gradle
apply plugin 'java'
dependencies {
compile 'com.example:plugin:1.0-SNAPSHOT'
}
I get the following error
Could not resolve all files for configuration ':my-project:buildSrc:runtimeClasspath'.
> Could not find com.example:plugin:1.0-SNAPSHOT.
I’m using Gradle 4.1