openrewrite / rewrite-gradle-plugin

OpenRewrite's Gradle plugin.
Apache License 2.0
65 stars 40 forks source link

Re-evaluate plugin publishing name/id #86

Closed aegershman closed 2 years ago

aegershman commented 2 years ago

Consider updating the generated name/id for gradlePlugin to set the metadata for rewrite-gradle-plugin to result in a GAV similar to Maven, e.g. org.openrewrite.maven:rewrite-maven-plugin, but for gradle; so, org.openrewrite.gradle:rewrite-gradle-plugin. Currently, the generated metadata for the rewrite-gradle-plugin results in referencing the plugin as org.openrewrite.rewrite. This is acceptable for gradle, but when publishing this to Maven, it results in gav coordinates of org.openrewrite:plugin (https://oss.sonatype.org/service/local/repositories/snapshots/content/org/openrewrite/plugin/maven-metadata.xml). And having to do something a little peculiar with pluginManagement when publishing snapshots:

pluginManagement {
    resolutionStrategy {
        eachPlugin {
            if (requested.id.namespace == "org.openrewrite") {
                useModule("org.openrewrite:plugin:${requested.version}")
            }
        }
    }
    ...
}

From https://github.com/openrewrite/rewrite-gradle-plugin/issues/84

sambsnyd commented 2 years ago

It's an unintentional consequence of the way that the plugin is built out of a subproject named "plugin". And it's incidental, not intentional, that it's setup that way. I'm fine with changing it, but I'm not sure if that would cause us any problems with publishing to the gradle plugin portal.