I’d like to test my plugins locally using SNAPSHOT versions. I could publish some special version, that I later delete manually, to the plugin portal but publishing and consuming locally seems better.
And Gradle documentation says it supports this, unless that documentation is out of date.
However, following the steps outlined there I could not get this to work.
In the plugin project I have the following (taken nearly verbatim from the doc page):
plugins {
...
// for local publishing
id 'maven-publish'
}
// local publishing (SNAPSHOT testing)
publishing {
repositories {
maven {
name = 'localPluginRepository'
url = "${buildDir}/local-plugin-repository"
}
}
}
I verified that the artifacts at least are published to that directory, so they are there.
The page is a bit unclear on exactly what to do on the consumer side, so maybe I am just messing this part up. I have tried 2 forms (new and old application of plugin):
// build.gradle
buildscript {
repositories {
maven {
url = "${path-to-local-plugin-repository}"
}
}
dependencies {
classpath "org.hibernate.orm:org.hibernate.orm.gradle.plugin:6.0.1-SNAPSHOT"
}
}
apply plugin: 'org.hibernate.orm'
this form leads to
> Could not resolve all artifacts for configuration ':classpath'.
> Could not resolve org.hibernate.orm:hibernate-core:6.0.1-SNAPSHOT.
And the “new form”:
// settings.gradle
pluginManagement {
repositories {
maven {
url "${path-to-local-plugin-repository}"
}
gradlePluginPortal()
}
}
// build.gradle
plugins {
...
id 'org.hibernate.orm'
}
which leads to
Plugin [id: 'org.hibernate.orm'] was not found in any of the following sources:
(notice it does not list any sources; that is not just a copy/paste error)
To note, I have also tried using the FQN of the plugin class in the id/apply, which also does not work.
Thanks for any ideas/pointers!