I would like to setup my project so that everything gets downloaded via company’s internal artifactory repository (firewall blocks all other urls). Here is my settings.gradle :
When I run gradle build it still looks in Gradle Central Plugin repository for plugins, what am I missing?
Error :
* What went wrong:
Plugin [id: 'org.gradle.kotlin.kotlin-dsl', version: '4.0.7'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:4.0.7')
Searched in the following repositories:
Gradle Central Plugin Repository
You use some convention plugins, either in buildSrc or in an included build.
These are built by an own build where you need the repositories as normal production repositories to be able to build your plugin.
You only defined it for the later stage where your convention plugin is applied to your main build.
I am using following plugins in buildSrc/build.gradle.kts
plugins { java-gradle-plugin kotlin-dsl
idea
}
I have also defined similar custom repositories block like mentioned above for settings.gradle in this build.gradle as well but for some reason when I build its first trying to look for plugins in Gradle Central plugin repository, I want it to look directly in repository url I am providing (here I am using artifactory for example )
As I said, buildSrc is a complete own build, did you define the repository in pluginManagement of buildSrc/settings.gradle(.kts)? Otherwise the plugins used to build buildSrc are looked up in the default, which is the plugin central.