Skip to content

Maven property resolves to a stale version #802

@bjaglin

Description

@bjaglin

steps

Issue detected on scalacenter/scalafix.g8#100

  • sbt 1.9.0
  • sbt-giter8 0.16.2

problem

  amm
Loading...
Welcome to the Ammonite Repl 2.5.2 (Scala 2.13.8 Java 11.0.19)
@ import $ivy.`org.foundweekends.giter8::giter8:0.16.2` 
import $ivy.$                                        

@ giter8.Maven.lookup((("scalafix_version", "maven(ch.epfl.scala, sbt-scalafix)")) :: Nil) 
res1: Either[String, giter8.G8.OrderedProperties] = Right(value = List(("scalafix_version", "0.10.4")))

expectation

-res1: Either[String, giter8.G8.OrderedProperties] = Right(value = List(("scalafix_version", "0.10.4")))
+res1: Either[String, giter8.G8.OrderedProperties] = Right(value = List(("scalafix_version", "0.11.0")))

since sbt-scalafix 0.11.0 is on Maven central:

notes

The problem seems to come from the REST API used to lookup the latest artifact, as https://search.maven.org/solrsearch/select?q=g:%22ch.epfl.scala%22+AND+a:%22sbt-scalafix%22&rows=10&wt=xml returns stale results as of June 8th (5 days after the missing artifact was published).

<?xml version="1.0" encoding="UTF-8"?>
<response>
    <lst name="responseHeader">
        <int name="status">0</int>
        <int name="QTime">3</int>
        <lst name="params">
            <str name="q">g:"ch.epfl.scala" AND a:"sbt-scalafix"</str>
            <str name="core"/>
            <str name="indent">off</str>
            <str name="spellcheck">true</str>
            <str name="fl">id,g,a,latestVersion,p,ec,repositoryId,text,timestamp,versionCount</str>
            <str name="start"/>
            <str name="spellcheck.count">5</str>
            <str name="sort">score desc,timestamp desc,g asc,a asc</str>
            <str name="rows">10</str>
            <str name="wt">xml</str>
            <str name="version">2.2</str>
        </lst>
    </lst>
    <result name="response" numFound="2" start="0">
        <doc>
            <str name="a">sbt-scalafix</str>
            <arr name="ec">
                <str>.pom</str>
                <str>.jar</str>
            </arr>
            <str name="g">ch.epfl.scala</str>
            <str name="id">ch.epfl.scala:sbt-scalafix724599971</str>
            <str name="latestVersion">0.10.4</str>
            <str name="p">jar</str>
            <str name="repositoryId">central</str>
            <arr name="text">
                <str>ch.epfl.scala</str>
                <str>sbt-scalafix</str>
                <str>.pom</str>
                <str>.jar</str>
            </arr>
            <long name="timestamp">1665436577000</long>
            <int name="versionCount">72</int>
        </doc>
        <doc>
            <str name="a">sbt-scalafix</str>
            <arr name="ec">
                <str>.jar</str>
                <str>.pom</str>
            </arr>
            <str name="g">ch.epfl.scala</str>
            <str name="id">ch.epfl.scala:sbt-scalafix-1555225206</str>
            <str name="latestVersion">0.9.29</str>
            <str name="p">jar</str>
            <str name="repositoryId">central</str>
            <arr name="text">
                <str>ch.epfl.scala</str>
                <str>sbt-scalafix</str>
                <str>.jar</str>
                <str>.pom</str>
            </arr>
            <long name="timestamp">1622413366000</long>
            <int name="versionCount">88</int>
        </doc>
    </result>
    <lst name="spellcheck">
        <lst name="suggestions"/></lst>
</response>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions