Changing the base artifact for gradle plugins

31 Views Asked by At

We have built a gradle plugin using

id("org.jetbrains.intellij") version "1.15.0" 
id("org.springframework.boot") version "2.7.16" 
id("io.spring.dependency-management") version "1.0.15.RELEASE" 

This is getting picked up by the central maven but we want it to be from the artifactory that we provide or from the local system path where I have downloaded the pom. Any leads will be appreciated.

We have tried using the below code but to no avail:

buildscript {
  repositories {
    maven {
      url=uri("url")
    }
  }
}
1

There are 1 best solutions below

3
Simon Jacobs On

Gradle searches for plugins defined inside the plugins block in repositories that are defined in the pluginManagement block of the settings.gradle.kts file (documentation).

For example:

// settings.gradle.kts

pluginManagement {
    repositories {
        // define any other repositories you like, eg
        maven { // details of own Maven repo }
        gradlePluginPortal() // The default setting, but must be re-specified if using this block if you still want to use it
    }
}