I have created the file:
GRADLE_HOME/init.d/settings.gradle
With the following content:
pluginManagement {
repositories {
maven {
url 'maven-repo'
}
gradlePluginPortal()
ivy {
url 'ivy-repo'
}
}
}
Which is consistent with the documentation.
However, I get the following error message while trying to build a project:
Only Settings scripts can contain a pluginManagement {} block.
I have run a debugging session with Gradle, and found out that settings.gradle
from the project is terated as the Settings
file, whereas the settings.gradle
from GRADLE_HOME/init.d
is not (see org.gradle.configuration.DefaultScriptPluginFactory.ScriptPluginImpl#wrap
).
Therefore my questions are:
- Is this a bug or am I doing something wrong?
- If this is a valid behavior, what is the other way of defining a global mirror for Gradle Plugins repository, outside of the project, in
GRADLE_HOME/init.d
? This is important since the sad fact is that I have to prepare an In-corporate Gradle package.