Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maven Metadata not showing latest version #6188

Open
1 of 3 tasks
andrewparmet opened this issue Feb 14, 2021 · 3 comments
Open
1 of 3 tasks

Maven Metadata not showing latest version #6188

andrewparmet opened this issue Feb 14, 2021 · 3 comments
Labels
good first issue New contributors, join in! service-badge Accepted and actionable changes, features, and bugs

Comments

@andrewparmet
Copy link

andrewparmet commented Feb 14, 2021

Are you experiencing an issue with...

馃 Description

Badges generated from Maven metadata use the last element of the versions list which may not be the latest version. In this case the latest version is 0.0.12, but the badge shows version 0.0.9.

馃敆 Link to the badge

https://img.shields.io/maven-metadata/v/https/plugins.gradle.org/m2/com/parmet/buf-gradle-plugin/maven-metadata.xml.svg?label=gradle-portal&color=yellowgreen
Gradle Portal

馃挕 Possible Solution

Instead of taking the last element of the list, use the metadata.version or metadata.versioning.latest or metadata.versioning.release element: https://plugins.gradle.org/m2/com/parmet/buf-gradle-plugin/maven-metadata.xml.

I'm actually not sure why the Maven Central badge is working - it seems to use a similar strategy.

https://img.shields.io/maven-central/v/com.parmet/buf-gradle-plugin
Maven Central

@andrewparmet andrewparmet added the question Support questions, usage questions, unconfirmed bugs, discussions, ideas label Feb 14, 2021
@calebcartwright
Copy link
Member

Looks like maven central sorts the versions properly, whereas the Gradle plugins does not

https://repo1.maven.org/maven2/com/parmet/buf-gradle-plugin/maven-metadata.xml

@calebcartwright calebcartwright added good first issue New contributors, join in! service-badge Accepted and actionable changes, features, and bugs and removed question Support questions, usage questions, unconfirmed bugs, discussions, ideas labels Feb 14, 2021
@andrewparmet
Copy link
Author

Of course - I hadn't actually clicked through. Do we know which property should be trusted? Based on the metadata model I'd say we probably want metadata.versioning.release?

@vlsi
Copy link

vlsi commented Feb 13, 2022

It looks like the version order is not consistent, so the better approach would be sorting the versions.

Here's how Maven sorts versions: gradle/gradle#11760 (comment)
Unfortunately, Gradle has slightly different rules gradle/gradle#11760 (comment), however it should not matter much for the badge use case

3flex added a commit to detekt/detekt that referenced this issue Jul 12, 2022
This is a little hacky, because the maven & plugin portal shields
often don't report the correct version: badges/shields#6188

Instead, we use the Maven Central method, which should have
the same version published as the Gradle Plugin Portal does.
chao2zhang pushed a commit to detekt/detekt that referenced this issue Jul 13, 2022
This is a little hacky, because the maven & plugin portal shields
often don't report the correct version: badges/shields#6188

Instead, we use the Maven Central method, which should have
the same version published as the Gradle Plugin Portal does.
VitalyVPinchuk pushed a commit to VitalyVPinchuk/detekt that referenced this issue Jul 25, 2022
This is a little hacky, because the maven & plugin portal shields
often don't report the correct version: badges/shields#6188

Instead, we use the Maven Central method, which should have
the same version published as the Gradle Plugin Portal does.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue New contributors, join in! service-badge Accepted and actionable changes, features, and bugs
Projects
None yet
3 participants