1

My company proxy/firewall settings are blocking jcenter and mavencentral etc, therefore, I can't get Gradle custom plugins from GitHub.

I'm using gradle 4.7 and still using that old way of getting plugins with buildscript{} - which is Gradle 1.x. I would like to use plugins{} and just put id's inside that block but I can't because of the default repository is trying to fetch it from.

Is there a way to amend plugins repo? Maybe in init.gradle or a cmd arg?

Or maybe just add another one to look at. I found a few links but those already expired and my last resort would be just to check the source code. I hope there is a simple answer to this.

Gradle 2.1 and higher want to use this

plugins {
    id "de.undercouch.download" version "3.4.3"
}

Gradle 1.x and 2.0 using this at the moment

buildscript {
    repositories {
        mynexusrepo()
    }
    dependencies {
        classpath 'de.undercouch:gradle-download-task:3.4.3'
    }
}

apply plugin: 'de.undercouch.download'
LazerBanana
  • 6,865
  • 3
  • 28
  • 47

1 Answers1

0

I found a working solution. It changed a few times already but for the 4.7 version of Gradle, this looks like a working solution.

Remember that some of the plugins need to be in GString "" !

This need to be in settings.gradle as the first block to work.

pluginManagement {
    repositories {
        maven { url "http://cdlnexus01:8081/nexus/content/groups/GradlePlugins/" }
        maven { url "http://cdlnexus01:8081/nexus/content/groups/public/" }
        maven { url "https://plugins.gradle.org/m2/" }
    }
}
LazerBanana
  • 6,865
  • 3
  • 28
  • 47