Caleb Cushing
10/07/2024, 3:02 PMVampire
10/07/2024, 3:10 PMpublishPlugins which publishes always to plugin central. As long as you do not call that task, it should not do that. For publishing to any arbitrary Maven repo, just use the normal maven-publish means. The Gradle Plugin Development Plugin should still integrate with the maven-publish plugin and declare the publications for the plugins and plugin marker artifacts. So if you do not want to publish to the portal at all, you probabably don't even need to apply the gradle plugin publish plugin.Caleb Cushing
10/07/2024, 3:14 PMCaleb Cushing
10/07/2024, 3:14 PMCaleb Cushing
10/07/2024, 3:14 PMCaleb Cushing
10/07/2024, 3:23 PMpublish it will publish the plugin fully correctly to the maven repo? and if I were to add such a repo as a repo that can be consumed as a plugin (some settings configuration), then I could still reference by the plugin id?Vampire
10/07/2024, 3:34 PMpublish does not get wired to publishPlugins by the plugin.
But just to make sure, execute ./gradlew publish -m to see which tasks will be executed.Caleb Cushing
10/07/2024, 4:17 PMCaleb Cushing
10/07/2024, 4:18 PMVampire
10/07/2024, 4:22 PMsure, I just wasn't certain it'd actually publish all of the gradle metadataShould so, yes.
so if I wanted to publish to either a private maven repo, or a public one depending on the job, is there a good way to do that outside of a big fat if statementDeclare both repositories and do not use
publish but publishAllPublicationsToPrivateRepository or publishAllPublicationsToPublicRepository respectively.Caleb Cushing
10/07/2024, 4:27 PMVampire
10/07/2024, 4:30 PMCaleb Cushing
10/07/2024, 8:39 PM<group>.<id>.gradle:plugin
... even though the id probably might contain the group. Mine doesCaleb Cushing
10/07/2024, 8:40 PMcom.xenoterracide.gradle.convention.publish.com.xenoterracide.gradle.convention.publish.gradle
Is needed so that id("com.xenoterracide.gradle.convention.publish") worksCaleb Cushing
10/07/2024, 8:43 PMVampire
10/07/2024, 9:25 PMid("com.xenoterracide.gradle.convention.publish") works you need the plugin marker artifact which is
com.xenoterracide.gradle.convention.publish:com.xenoterracide.gradle.convention.publish.gradle.plugin:<plugin version> (<plugin id>:<plugin id>.gradle.plugin:<plugin version>).
It depends on the artifact with the actual code.
Under which coordinates the code artifact is published is fully your decision.
It is the normal <project group>:<project name> by default.Caleb Cushing
10/07/2024, 9:27 PMCaleb Cushing
10/07/2024, 9:27 PM<dependency>
<groupId>com.xenoterracide.gradle.convention.publish.com.xenoterracide.gradle.convention.publish.gradle</groupId>
<artifactId>plugin</artifactId>
<version>0.0.1-alpha.0.7+04630115</version>
</dependency>Caleb Cushing
10/07/2024, 9:28 PMCaleb Cushing
10/07/2024, 9:29 PMcom.xenoterracide.gradle.convention:publish:Caleb Cushing
10/07/2024, 9:32 PMgradlePlugin {
plugins {
create("pub") {
id = "${rootProject.group}.${project.name}"
displayName = "My conventions for publishing"
tags = setOf("publish", "convention")
implementationClass = "$id.PublishPlugin"
}
}
}
and it's creating these for maven
publication plugin com.xenoterracide.gradle.convention.publish:0.0.0
publication pluginMaven com.xenoterracide.gradle.convention:publish:0.0.0
publication pluginPluginMarkerMaven com.xenoterracide.gradle.convention:publish:0.0.0Caleb Cushing
10/07/2024, 9:35 PMplugin com.xenoterracide.gradle.convention com.xenoterracide.gradle.convention.publish:0.0.0Caleb Cushing
10/07/2024, 9:35 PM<group> <id>:<version>Caleb Cushing
10/07/2024, 9:36 PMCaleb Cushing
10/07/2024, 9:36 PMCaleb Cushing
10/07/2024, 9:53 PMCaleb Cushing
10/07/2024, 9:54 PMPrecompiled script plugin '/home/xeno/IdeaProjects/gradle-convention/buildSrc/src/main/kotlin/our.javalibrary.gradle.kts' line: 1
* What went wrong:
An exception occurred applying plugin request [id: 'com.xenoterracide.gradle.convention.publish']
> Failed to apply plugin 'com.xenoterracide.gradle.convention.publish'.
> Cannot query the value of extension 'repositoryHost' property 'namespace' because it has no value available.
wait, repositoryHost... that's in my extension, sigh...Vampire
10/07/2024, 10:21 PMand it's creating these for maven
```publication plugin com.xenoterracide.gradle.convention.publish:0.0.0
publication pluginMaven com.xenoterracide.gradle.conventionpublish0.0.0
publication pluginPluginMarkerMaven com.xenoterracide.gradle.conventionpublish0.0.0```Who is "it"? Where is the "publication plugin" coming from?
pluginMaven and pluginPluginMarkerMaven should be the one created for you iirc.
https://github.com/xenoterracide/gradle-convention/packages/2275134 is what got createdThis looks a bit shifted. If this should be the marker artifact, it should not be
<dependency>
<groupId>com.xenoterracide.gradle.convention.publish.com.xenoterracide.gradle.convention.publish.gradle</groupId>
<artifactId>plugin</artifactId>
<version>0.0.1-alpha.0.8+cb482dec</version>
</dependency>
but
<dependency>
<groupId>com.xenoterracide.gradle.convention.publish</groupId>
<artifactId>com.xenoterracide.gradle.convention.publish.gradle.plugin</artifactId>
<version>0.0.1-alpha.0.8+cb482dec</version>
</dependency>
So all before .plugin wandered to the group somehow.Vampire
10/07/2024, 10:23 PMcom.xenoterracide.gradle.convention.publish.gradle.plugin-0.0.1-alpha.0.8+cb482dec.pom, this might just be a web display glitch of GPRCaleb Cushing
10/07/2024, 10:27 PMCaleb Cushing
10/07/2024, 10:27 PMCaleb Cushing
10/07/2024, 10:28 PMVampire
10/07/2024, 10:34 PMCaleb Cushing
10/07/2024, 10:35 PM