ajoberstar / reckon

Infer a project's version from your Git repository.
Apache License 2.0
191 stars 28 forks source link

Gradle plugins register/portal is not in sync with GitHub releases #176

Closed x80486 closed 2 years ago

x80486 commented 2 years ago

Somehow the last released version in the Gradle plugins portal/register is 0.13.2-rc.4 (which is not even in GitHub as far as I can tell). The last release in GitHub is 0.16.1.

I think most people will use the Gradle portal before coming to GitHub. Not sure how anything gets into that portal, but somehow something in not in sync with it.

mjstrasser commented 2 years ago

The README states that recent versions are on Maven Central.

This configuration worked for me (Kotlin DSL). In settings.gradle.kts:

pluginManagement {
    repositories {
        mavenCentral()
        gradlePluginPortal()
    }
}

NB: Specify mavenCentral() first.

Then, in build.gradle.kts:

plugins {
    id("org.ajoberstar.reckon") version "0.16.1"
}

Hope this helps!

ajoberstar commented 2 years ago

@x80486 My rationale is described in one of grgit's issues.

As for adding mavenCentral() to your pluginManagement that shouldn't be necessary. Gradle's plugin portal proxies Central, so you will be able to pick up the plugin without customizing your pluginManagement.repositories. That said I do find the portal to be a tad brittle sometimes, so using central directly can sometimes be useful.

x80486 commented 2 years ago

What I tried to say is that if someone browse over Gradle's portal, there is no 0.16.1 version, but 0.13.2-rc.4 as latest.

image

Thus, I don't know how do you synchronize that gap between the Gradle portal and GitHub releases.

ajoberstar commented 2 years ago

Right, the portal UI will not show that newer versions of the plugin are available. That requires the API incantations that the com.gradle.plugin-publish plugin does. However, the plugin portal repo proxies JCenter and Maven Central, so anything available in those two is available without extra configuration in your build.

For example, this URL will download the 0.16.1 POM, even though in the UI it doesn't look like it's available.

https://plugins.gradle.org/m2/org/ajoberstar/reckon/reckon-gradle/0.16.1/reckon-gradle-0.16.1.pom

This means that you do not need to customize your pluginManagement.repositories to get the latest version of reckon.

I understand that it can be confusing for a user that the latest version isn't indicated in the portal UI, but the reasons outlined in that grgit issue override that convenience for me as a maintainer.

x80486 commented 2 years ago

OK, great. I just didn't know if you were aware of that — or not. I can close this one :sunglasses: