Stephan Schroeder
04/29/2019, 5:15 PMgroup = "uk.co.mulecode"
version = "1.0.0-SNAPSHOT"
...
gradlePlugin {
plugins {
create("easy-scm") {
id = "uk.co.mulecode.easy-scm"
implementationClass = "uk.co.mulecode.EasyScm"
}
}
}
after running gradle install
I can find it in /Users/MDuke/.m2/repository/uk/co/mulecode/easy-scm/1.0.0-SNAPSHOT/easy-scm-1.0.0-SNAPSHOT.jar. Still when trying to use it in another project by importing it locally
buildscript {
repositories {
mavenLocal()
// mavenCentral()
}
dependencies {
// classpath("uk.co.mulecode:easy-scm:1.0.0-SNAPSHOT")
// classpath("uk.co.mulecode:uk.co.mulecode.easy-scm:1.0.0-SNAPSHOT")
classpath(group = "uk.co.mulecode", name="easy-scm", version = "1.0.0-SNAPSHOT")
}
}
plugins {
id("java")
id("maven")
id("uk.co.mulecode.easy-scm") version "1.0.0-SNAPSHOT"
}
...
it isn’t found, as can be seen by running `gradle tasks`:
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/SSchrod/progs/progtests/sandbox-project/build.gradle.kts' line: 12
* What went wrong:
Plugin [id: 'uk.co.mulecode.easy-scm', version: '1.0.0-SNAPSHOT'] 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 'uk.co.mulecode.easy-scm:uk.co.mulecode.easy-scm.gradle.plugin:1.0.0-SNAPSHOT')
Searched in the following repositories:
Gradle Central Plugin Repository
the artifact path looks pretty messed up but I just can’t figure out what the problem is. To add insult to injury importing of the plugin actually works from an equivalent Groovy-DSL gradle project.octylFractal
04/29/2019, 5:20 PMsettings.gradle.kts
instead, using pluginManagement
https://docs.gradle.org/current/userguide/plugins.html#sec:plugin_managementplugins {}
is not supposed to reference/rely on buildscript
content, including repositoriesStephan Schroeder
04/30/2019, 8:35 AM//settings.gradle.kts
pluginManagement {
resolutionStrategy {
eachPlugin {
if (requested.id.namespace == "uk.co.mulecode") {
useModule("uk.co.mulecode:simple-version:1.0.0-SNAPSHOT")
}
}
}
repositories {
mavenLocal()
gradlePluginPortal()
}
}
efemoney
05/01/2019, 4:08 AMif (requested.id.namespace == "uk.co.mulecode")
Since you are specifying the version inline also