How do you publish multiple plugins from a single ...
# community-support
l
How do you publish multiple plugins from a single project? I can declare both of them using
gradlePlugins.create
, but they both publish under the same group: the name of the project.
My current buildscript looks like this, with project name "architectury-extensions-plugin":
Copy code
group = "btpos.gradle.architectury"
version = "1.0.0"

gradlePlugin {
	plugins {
		create("commonOnly") {
			id = "architectury-extensions-common"
			implementationClass = "btpos.gradle.architectury.architecturyextensions.ArchExtendedPlugin_Common"
		}
		create("platformOnly") {
			id = "architectury-extensions-platform"
			implementationClass = "btpos.gradle.architectury.architecturyextensions.ArchExtensionsPlugin_Platform"
		}
	}
}
But running
publishToMavenLocal
publishes it under the coordinates
architectury-extensions-plugin:btpos.gradle.architectury.architecturyextensions:1.0.0
, which is pretty much the exact opposite of what I want.
v
What do you mean by "opposite"? Also, better not use a plugin id without namespace (dot somewhere), those plugin IDs should stay reserved for built-in plugins. If you have the plugins in one project, their code publishes in one code artifact. If you want it in different code artifacts, you have to put the code into multiple projects (which can be projects in the same build). But either way, you have one additional POM-only artifact, the marker artifact, per plugin. This marker artifact
<plugin id>:<plugin id>. gradle.plugin:<plugin version>
is, what is used to translate from plugin ID in
plugins { ... }
block to the actual code artifact of the plugin.