Hi, I am trying to enable dependabot to find the r...
# plugin-development
r
Hi, I am trying to enable dependabot to find the release notes from our plugin I added the url here, but it seems to be the wrong pom file. I tried registering another publication:
Copy code
publishing {
    publications {
      register("pluginMaven", MavenPublication::class) {
        pom {
          url.set("<https://github.com/europace/docker-publish-gradle-plugin>")
        }
      }
      register("dockerPublishPluginPluginMarkerMaven", MavenPublication::class) {
        pom {
          url.set("<https://github.com/europace/docker-publish-gradle-plugin>")
        }
      }
    }
  }
}
But I get the error:
Copy code
> Cannot add a Publication with name 'dockerPublishPluginPluginMarkerMaven' as a Publication with that name already exists.
Any idea what I am doing wrong? I could not find any documentation about the adaption of the pom file. Here they mention the publications, but I do not understand how to enrich the root pom file
v
The plugin publish plugin already creates those publications for you. By using
register
you try to also create them and thus get the error that the publication already exists. Use
named(...)
instead of
register(...)
to get the already existing publication and then just configure that already existing publication.
r
@Vampire thanks for your answer. When I change the
register
to
named
I get this error:
Copy code
Publication with name 'dockerPublishPluginPluginMarkerMaven' not found.
Any Idea what I am doing wrong? The whole plugin section is:
Copy code
gradlePlugin {
  website.set("<https://github.com/europace/docker-publish-gradle-plugin>")
  vcsUrl.set("<https://github.com/europace/docker-publish-gradle-plugin>")
  plugins {
    create("dockerPublishPlugin") {
      id = "de.europace.docker-publish"
      displayName = "Docker Publish Plugin"
      description = "Adds tasks to create and publish a Docker image to a registry"
      implementationClass = "de.europace.gradle.docker.publish.DockerPublishPlugin"
      tags.set(listOf("docker", "publish", "publishing"))
    }
  }
  publishing {
    publications {
      named("dockerPublishPluginPluginMarkerMaven", MavenPublication::class) {
        pom {
          url.set("<https://github.com/europace/docker-publish-gradle-plugin>")
        }
      }
    }
  }
}
v
Maybe it is registered after that point. If you anyway want to set this on all publications, I'd just do
publications.withType(MavenPublication::class).configureEach { ... }
. If not, then something like
publications.withType(MavenPublication::class).named { it == "..." }.configureEach { ... }
.
r
@Vampire sorry I was on holiday. many thanks for the help, it worked now 🙂
👌 1
@Vampire I finally found the pom.xml file in the gradle plugin repo Unfortunately there is no URL in this pom file. Any idea how I can add the information to the main pom file? I seem only to add it to other files? 🙈
Btw. you can also test it by just calling the respective "generatePom..." task without the need to actually publish
r
but I thought I add it to all publications, so I am confused 🙈
I did test it and all poms I could see had it, so now I do not know which pom it actually is that I need to adapt
v
Hm, strange, looks fine to me and also works when publishing to maven local 😕
r
Yeah that is my problem and that is why I keep making pull requests 🙈
Does anybody else maybe have an idea what is going on here and how I can fix it? 🙂
p
BTW is the plugin open sourced? If not, I never managed to get the release notes of an internal dependency.
v
@Philip W sure, the URL is right in the OP where she shows how she configures it 🙂
r
Our plugin repo is here 🙂
In my latest update I can see the scm and url section in the pom when I publish to maven local, but on the gradle plugin portal I still cannot see the URLs. Any idea what I can do to fix that?
So from the dependabot support I now got the news that I need to add the URL to this pom file Here you can see my code of adding the url to the pom file. but none seems to end up in the needed pom file. Any idea what I can do to fix that?
t
The plugin marker POMs are generated by the plugin portal (or the plugin publish plugin) and you can't do anything about it: https://github.com/gradle/plugin-portal-requests/issues/212
r
@Thomas Broyer thanks for the link. in there they mention that it should work though, or did I understand this comment wrongly?
t
r
Thanks. I added a comment on that issue and hopefullt I get an answer 🙂