Suhas Sharma
04/07/2025, 5:20 PMChristian Grach
04/07/2025, 5:22 PMChristian Grach
04/07/2025, 5:25 PM• Avoid posting the same question on multiple channels. One channel is enough, and if needed to repost to another channel, post the link to avoid duplication.
https://community.gradle.org/contributing/community-slack/#asking-questions-on-slack
Philip W
04/07/2025, 5:40 PMSuhas Sharma
04/07/2025, 5:51 PMChristian Grach
04/07/2025, 5:55 PMfrom
part in https://docs.gradle.org/current/userguide/publishing_maven.html#ex-customizing-the-publication-identityVampire
04/07/2025, 8:06 PMpublishing
block as it is pointless.Vampire
04/07/2025, 8:07 PMmavenLocal()
(which you should avoid to ever use whenever possible) is always available for publishing and never needs to be declared explicitly for publishingVampire
04/07/2025, 8:07 PMjava-gradle-plugin
already registers the publications you need for your plugin for you, one for the code artifact and one for the marker artifact of each plugin.Vampire
04/07/2025, 8:08 PMjava-gradle-plugin
and maven-publish
plugin is sufficient and your whole publishing
block should go away.Suhas Sharma
04/08/2025, 2:12 AMplugins {
kotlin("jvm") version "1.9.24"
`java-gradle-plugin`
`maven-publish`
}
group = "dev.haas"
version = "1.0.0"
repositories {
mavenCentral()
gradlePluginPortal()
}
dependencies {
implementation(kotlin("stdlib"))
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.24")
}
kotlin {
jvmToolchain(17)
}
gradlePlugin {
plugins {
create("kotlinPlugin") {
id = "dev.haas.kotlinplugin"
implementationClass = "dev.haas.SourceInspectionPlugin"
}
}
}
Test- Build.gradle.kts:
plugins {
id("dev.haas.kotlinplugin") version "1.0.0"
}
group = "dev.haas"
version = "1.0-SNAPSHOT"
repositories {
gradlePluginPortal()
mavenCentral()
}
dependencies {
testImplementation(platform("org.junit:junit-bom:5.10.0"))
testImplementation("org.junit.jupiter:junit-jupiter")
}
tasks.test {
useJUnitPlatform()
}
Suhas Sharma
04/08/2025, 2:13 AMTask :generateMetadataFileForPluginMavenPublicationCaching disabled for task ':generateMetadataFileForPluginMavenPublication' because: Build cache is disabled Not made cacheable, yet Task ':generateMetadataFileForPluginMavenPublication' is not up-to-date because: Task.upToDateWhen is false. Resolve mutations for :generatePomFileForPluginMavenPublication (Thread[Execution worker,5,main]) started. :generatePomFileForPluginMavenPublication (Thread[Execution worker,5,main]) started.
Task :generatePomFileForPluginMavenPublicationCaching disabled for task ':generatePomFileForPluginMavenPublication' because: Build cache is disabled Task ':generatePomFileForPluginMavenPublication' is not up-to-date because: Task is untracked because: Gradle doesn't understand the data structures used to configure this task Resolve mutations for :publishPluginMavenPublicationToMavenLocal (Thread[Execution worker,5,main]) started. :publishPluginMavenPublicationToMavenLocal (Thread[Execution worker,5,main]) started.
Task :publishPluginMavenPublicationToMavenLocalCaching disabled for task ':publishPluginMavenPublicationToMavenLocal' because: Build cache is disabled Task ':publishPluginMavenPublicationToMavenLocal' is not up-to-date because: Task has not declared any outputs despite executing actions. Publishing to maven local repository Resolve mutations for :publishToMavenLocal (Thread[Execution worker,5,main]) started. :publishToMavenLocal (Thread[Execution worker,5,main]) started.
Task :publishToMavenLocalSkipping task ':publishToMavenLocal' as it has no actions. BUILD SUCCESSFUL in 735ms 10 actionable tasks: 6 executed, 4 up-to-date
Suhas Sharma
04/08/2025, 2:15 AMSuhas Sharma
04/08/2025, 2:34 AMplugins {
kotlin("jvm") version "1.9.24"
`java-gradle-plugin`
`maven-publish`
}
group = "dev.haas"
version = "1.0.0"
repositories {
mavenCentral()
gradlePluginPortal()
}
dependencies {
implementation(kotlin("stdlib"))
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.24")
}
kotlin {
jvmToolchain(17)
}
publishing {
publications {
create<MavenPublication>("maven") {
groupId = "dev.haas"
artifactId = "kotlingradleplugin"
version = "2.0"
from(components["java"])
}
}
}
with this when i publish i get two plugins created:
~/Kotlin/untitled3 git:[main]
ls ~/.m2/repository/dev/haas/
kotlingradleplugin untitled3
but when i try to use it none of them work
plugins {
id("dev.haas.kotlingradleplugin") version "2.0"
}
or
plugins {
id("dev.haas.untitled3") version "1.0.0"
}
Vampire
04/08/2025, 2:36 AMSuhas Sharma
04/08/2025, 2:37 AMVampire
04/08/2025, 2:39 AMSearched in the following repositories:
Gradle Central Plugin Repository
You do not have Maven local as plugin repository
Suhas Sharma
04/08/2025, 2:39 AMSuhas Sharma
04/08/2025, 2:39 AMplugins {
id("dev.haas.untitled3") version "1.0.0"
}
group = "dev.haas"
version = "1.0-SNAPSHOT"
repositories {
mavenLocal()
gradlePluginPortal()
mavenCentral()
}
dependencies {
testImplementation(platform("org.junit:junit-bom:5.10.0"))
testImplementation("org.junit.jupiter:junit-jupiter")
}
tasks.test {
useJUnitPlatform()
}
my test project build fileVampire
04/08/2025, 2:40 AMSuhas Sharma
04/08/2025, 2:40 AMSuhas Sharma
04/08/2025, 2:46 AMVampire
04/08/2025, 2:56 AMVampire
04/08/2025, 2:56 AMVampire
04/08/2025, 2:57 AMVampire
04/08/2025, 2:57 AMSuhas Sharma
04/08/2025, 2:57 AMSuhas Sharma
04/08/2025, 2:57 AMVampire
04/08/2025, 2:58 AMSuhas Sharma
04/08/2025, 3:01 AMVampire
04/08/2025, 6:47 AMSuhas Sharma
04/08/2025, 10:16 AMplugins {
kotlin("jvm") version "1.9.24"
`java-gradle-plugin`
`maven-publish`
}
group = "dev.haas"
version = "1.0.0"
repositories {
mavenCentral()
gradlePluginPortal()
}
dependencies {
implementation(kotlin("stdlib"))
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.24")
}
kotlin {
jvmToolchain(17)
}
my project name is untitled3
so i should refernece with dev.haas.untitled3
with version1.0.0
id("dev.haas.untitled3") version "1.0.0"
pluginManagement {
repositories {
mavenCentral()
mavenLocal()
}
}
added this to settings gradle
still doesnt work
Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Included Builds (No included builds contain this plugin)
- Plugin Repositories (could not resolve plugin artifact 'dev.haas.untitled3dev.haas.untitled3.gradle.plugin1.0.0')
Searched in the following repositories:
MavenRepo
MavenLocal(file:/home/suhas-koheda/.m2/repository/)
at org.gradle.plugin.use.resolve.internal.PluginResolutionResult.getFound(PluginResolutionResult.java:112)
at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.resolvePluginRequest(DefaultPluginRequestApplicator.java:192)
at org.gradle.Laura Kassovic
04/08/2025, 7:43 PMpluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
}
}
and commented out the publishing block in your build file.
And it worked fine when i published to maven local:Vampire
04/08/2025, 8:39 PMpublishing
block.
But you also now removed the gradlePlugin
block.
Without that, you do not have any plugin defined, so no marker artifact is published and hence no plugin to consume.