so if I want to publish a plugin to a 3rd party se...
# community-support
c
so if I want to publish a plugin to a 3rd party server, meaning not the real plugin portal, what do I need to do?
p
The gradle plugin portal is just a regular maven repository under the hood. You can just publish your custom plugin to eg mavenCentral, or any maven (or ivy etc.) repository and add the repository to your build script repositories (eg in pluginManagement in settings.gradle).
t
I wouldn't say "the gradle plugin portal is just a regular maven repository under the hood": it uses a special plugin for publishing. Publishing to any other repository will just use the java-gradle-plugin and the appropriate publishing plugin.
v
Just make sure to publish all publications that plugin publish plugin registered for you. If you miss the marker artifacts, your consumers cannot find it by ID in plugins block.
I wouldn't say "the gradle plugin portal is just a regular maven repository under the hood": it uses a special plugin for publishing.
But it is. It even uses the
maven-publish
plugin for the actual artifact publishing. It just has on top a layer with the metadata shown in the UI and that is probably transmitted then by the special publish task?
It even uses the
maven-publish
plugin for the actual artifact publishing.
Oh, does it? I thought it only used it to generate the POMs but then published artifacts by itself.
👀 1
p
Sorry, but the docs are not correct. The are, they talk about the Java Gradle plugin, that adds the marker artifact if you just call
:publish
and not specify specific publications.
But you don't need the Gradle publishing plugin if you don't want to publish to the Gradle plugin portal.
👆 3
c
well, I was going to publish releases to the portal but "snapshots" to a github repo
s
We publish a Gradle plugin to a 3rd party repo, it’s as simple as using the
publish
task instead of
publishPlugins
.
c
so all of that metadata is created and published with the normal publish plugin. e.g.
id("foo.bar") version( ... )
will work
👍 1
s
yes
➕ 1
👍 1
t
I thought it only used it to generate the POMs but then published artifacts by itself.
Fwiw, I looked at the code and it confirms this.
đŸ„‡ 1
m
TIL the publish plugin is actually open source 👀
v
Fwiw, I looked at the code and it confirms this.
Ok, great, then I got that wrong. Then they probably only now configure the publications and so on so that you can configure the POM in known way and can easily publish to another repo using
maven-publish
so all of that metadata is created and published with the normal publish plugin. e.g.
id("foo.bar") version( ... )
will work
As I said, yes, as long as you publish all publications, including the plugin marker publications. Those are responsible for translating the plugin id to the actual code artifact.