Custom Plugin Transitive Dependency Maven Repos

plugins

(Hoobajoob) #1

Hello,

We have a custom plugin that we retrieve from an internal maven repository. This plugin has a dependency on a gradle plugin that comes from the public gradle plugin repo.

In the projects that use the custom plugin, they obviously have to configure our local maven repo in order to resolve our custom plugin, like so:

buildscript {
    repositories {
        maven { url 'http://internal-maven-repo' }
    }

    dependencies {
        classpath "org.github.hoobajoob:custom-plugin:1.0.0"
    }
}

Question: is there anything I can do in the plugin to avoid requiring the users of the custom plugin to add the public maven repo to their buildscript block in order to retrieve the custom plugin’s transitive dependency?

At the moment we aren’t able to configure the internal repo to mirror the public gradle repo.

Currently, we have to add the public repo to the buildscript block like so:

buildscript {
    repositories {
        maven { url 'http://internal-maven-repo' }
        maven { url 'https://plugins.gradle.org/m2' } // any way to avoid this?
    }

    dependencies {
        classpath "org.github.hoobajoob:custom-plugin:1.0.0"
    }
}