TLDR: I want to download plugin id("org.gradle.kotlin.kotlin-dsl")
using proxy.
I work in a big corporation and there are strict rules regarding internet access. I have to download every library using corpo proxy.
Lately I've implemented buildSrc
, and inside it I have build.gradle
with following content:
plugins {
id("org.gradle.kotlin.kotlin-dsl") version "1.3.3"
id("groovy")
}
repositories {
maven { url "http://corpo.proxy....." }
maven { url "http://corpo.proxy....." }
}
dependencies {
gradleApi()
localGroovy()
implementation 'commons-codec:commons-codec:1.15'
implementation 'com.squareup:javapoet:1.10.0'
implementation 'com.squareup:kotlinpoet:1.0.0-RC1'
compileOnly("com.android.tools.build:gradle:4.0.1")
implementation("com.android.tools.build:gradle:4.0.1")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20")
}
Also, following this topic: How can the gradle plugin repository be changed?
I've implemented pluginManagement
inside settings.gradle
:
pluginManagement {
resolutionStrategy {
eachPlugin {
if (requested.id.namespace == 'org.gradle.sample') {
useModule('org.gradle.sample:sample-plugins:1.0.0')
}
}
}
repositories {
maven { url "http://corpo.proxy..." }
maven { url "http://corpo.proxy..." }
}
}
But unfortunately gradle is still trying to download kotlin-dsl plugin via google url, instead of using proxy url.
What am I doing wrong?
Many thanks!