Search code examples
sbtivy

SBT is not downloading dependencies to ivy cache after upgrade 0.13.9 -> 1.1.2


I have an SBT project with following resolvers definition:

resolvers += Resolver.mavenLocal
resolvers += Resolver.url("my-release", url("https://myrepo.net/artifactory/libs-release"))
resolvers += Resolver.url("my-snapshot", url("https://myrepo.net/artifactory/libs-snapshot-local"))

(I changed my company's repo URLs).

SBT 0.13.9 was able to resolve my company's artifacts from the specified repositories (including maven local), but when I try to upgrade to 1.1.2, it seems to only resolve the artifacts that are already downloaded to local ivy cache. New artifacts are not found. Here's a part of the output from running sbt update command:

[warn]  module not found: com.mycompany.artifact#my-artifact;1.2.3
[warn] ==== local: tried
[warn] ==== public: tried
[warn] ==== local-preloaded-ivy: tried
[warn] ==== local-preloaded: tried
[warn] ==== Maven2 Local: tried
[warn] ==== my-release: tried
[warn] ==== my-snapshot: tried
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.mycompany.artifact#my-artifact;1.2.3: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::

So it seems to check my repos, but still fails to find the artifact.

What I can do as a workaround is to rollback to SBT 0.13, build a project at least once (0.13 will add the missing artifact to ivy cache), and then change the version back to 1.1.2.

UPDATE: It looks that for maven repositories you need to use at instead of Resolver.url:

resolvers += "my-release" at "https://myrepo.net/artifactory/libs-release"
resolvers += "my-snapshot" at "https://myrepo.net/artifactory/libs-snapshot-local"

This way it works properly.


Solution

  • It looks that for maven repositories you need to use at instead of Resolver.url:

    resolvers += "my-release" at "https://myrepo.net/artifactory/libs-release"
    resolvers += "my-snapshot" at "https://myrepo.net/artifactory/libs-snapshot-local"
    

    This way it works properly.