How to publish/mirror a plugin available from Maven Central to the Gradle Plugin Portal

Hi,

I’m Marc Nuri and I’m currently leading the efforts for Eclipse JKube [1].

We recently released our Kubernetes and OpenShift Gradle plugins to Maven Central [2] [3] (org.eclipse.jkube.kubernetes & org.eclipse.jkube.openshift).
We would also like to include these plugins in the official Gradle Plugin Portal.

However, our entire build process is based on Maven, including the Gradle plugin projects.
All of the documentation I’ve found related to publishing to the portal is based on the “Plugin Publishing” plugin.
Is there any alternative method, or any way we could mirror what gets published on Maven central?

[1] GitHub - eclipse/jkube: Successor of the deprecated Fabric8 Maven Plugin
[2] Maven Central Repository Search
[3] Maven Central Repository Search


Marc

Actually the plugin portal delegates to JCenter for things it does not have which in turn delegates to Maven Central for things it does not have.
So your plugin is already available through the plugin portal.
You are basically two things missing.

If you don’t publish to the plugin portal directly, you are not listed in the plugin portal search, so your discoverability is worse. I for example first search on the portal if I need a plugin for a certain purpose and only after that maybe ask Google, but I as user expect any sane and maintained plugin to be available on the portal search.

The second thing is the resolution from plugin id to plugin jar when the plugins is used, which is highly recommended.
So if someone writes plugins { id("org.eclipse.jkube.kubernetes") version "1.5.1" }, Gradle has to know how to resolve this plugin ID to the actual plugin JAR. This can be achieved by manually mapping it in the setting script, but the normal way is, that you publish another “marker” artifact with coordinates org.eclipse.jkube.kubernetes:org.eclipse.jkube.kubernetes.gradle.plugin:1.5.1 that does not have a JAR but just has a dependency on the actual JAR with the plugin code, this way you can also have multiple plugins in one JAR.

You can probably create and release this marker artifact additionally with Maven to Maven Central, and though I didn’t test it yet, I’d expect it to work through the plugin portal, then only the discoverability will be missing.

I’m not aware of a Maven plugin to publish to Plugin Portal.
But maybe you can implement this publishing step as separate Gradle project and then execute that Gradle project through some Maven plugin that allows to trigger a Gradle build?

Hi Vampire,

Thx for your reply.

…that you publish another “marker” artifact with coordinates org.eclipse.jkube.kubernetes:org.eclipse.jkube.kubernetes.gradle.plugin:1.5.1

This is exactly what we’re doing, the links to Maven Central [1] [2] I pasted in the first post have these coordinates. I think this was mentioned somewhere in the documentation. We kind of figured out this and provided specific coordinates for the Gradle plugins.

You can easily reference our plugins by

plugins {
    id 'org.eclipse.jkube.kubernetes' version '1.5.1'
    id 'org.eclipse.jkube.openshift' version '1.5.1'
}

There’s already a bunch of quickstarts [3] if anyone is interested.

If you don’t publish to the plugin portal directly, you are not listed in the plugin portal search, so your discoverability is worse.

This is exactly our concern. We’d like to be featured in the Plugin Portal. If there’s nothing available, maybe we can contribute something for those of us who are using this “Maven First” approach.

[1] org.eclipse.jkube.kubernetes:org.eclipse.jkube.kubernetes.gradle.plugin
[2] org.eclipse.jkube.openshift:org.eclipse.jkube.openshift.gradle.plugin
[3] https://github.com/eclipse/jkube/tree/master/quickstarts/gradle

Ah, sorry, I totally missed that detail.
But my other points stand.
There might be some way, but I’m not aware of it.
Afaik you have to use the plugin publish Gradle plugin and I’m not aware of a Maven alternative.
Maybe you can somehow build some Maven plugin that wraps the plugin publish plugin and maybe creates an ad-hoc Gradle build that is then ad-hoc executed or something similar.

You could maybe also open an issue at GitHub - gradle/plugin-portal-requests: Gradle Plugin Portal issues and requests. to get the feature or some information.