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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to download an sbt plugin, but why did sbt attempt to download from that URL? #1201

Closed
TomasMikula opened this issue Apr 11, 2024 · 1 comment

Comments

@TomasMikula
Copy link

Can sbt explain why it attempted to download a given artifact?

Given a minimal setup

build.sbt

lazy val root = (project in file("."))
  .settings(
    scalaVersion := "2.12.19",
  )

project/build.properties

sbt.version=1.9.9

project/plugins.sbt

addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.2.0")

(and nothing else in the project directory),

after also deleting the C:\Users\X01344637\.sbt\repositories file,

running sbt I get this error:

C:\Users\X01344637\tmp\sbt-plugin-test>sbt
[info] welcome to sbt 1.9.9 (Oracle Corporation Java 17.0.2)
[info] loading settings for project sbt-plugin-test-build from plugins.sbt ...
[info] loading project definition from C:\Users\X01344637\tmp\sbt-plugin-test\project
[info] Updating
[info] Resolved  dependencies
[warn]
[warn]  Note: Some unresolved dependencies have extra attributes.  Check that these dependencies exist with the requested attributes.
[warn]          com.eed3si9n:sbt-assembly:1.2.0 (sbtVersion=1.0, scalaVersion=2.12)
[warn]
[warn]  Note: Unresolved dependencies path:
[error] sbt.librarymanagement.ResolveException: Error downloading com.eed3si9n:sbt-assembly;sbtVersion=1.0;scalaVersion=2.12:1.2.0
[error]   not found: https://my.company.com/nexus/repo/com/eed3si9n/sbt-assembly/1.2.0/sbt-assembly-1.2.0.pom
[error]         at lmcoursier.CoursierDependencyResolution.unresolvedWarningOrThrow(CoursierDependencyResolution.scala:344)
[error]         at lmcoursier.CoursierDependencyResolution.$anonfun$update$38(CoursierDependencyResolution.scala:313)
[error]         at scala.util.Either$LeftProjection.map(Either.scala:573)
[error]         at lmcoursier.CoursierDependencyResolution.update(CoursierDependencyResolution.scala:313)
[error]         at sbt.librarymanagement.DependencyResolution.update(DependencyResolution.scala:60)
[error]         at sbt.internal.LibraryManagement$.resolve$1(LibraryManagement.scala:60)
[error]         at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$12(LibraryManagement.scala:134)
[error]         at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:74)
[error]         at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$20(LibraryManagement.scala:147)
[error]         at scala.util.control.Exception$Catch.apply(Exception.scala:228)
[error]         at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11(LibraryManagement.scala:147)
[error]         at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11$adapted(LibraryManagement.scala:128)
[error]         at sbt.util.Tracked$.$anonfun$inputChangedW$1(Tracked.scala:220)
[error]         at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:161)
[error]         at sbt.Classpaths$.$anonfun$updateTask0$1(Defaults.scala:3801)
[error]         at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error]         at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:63)
[error]         at sbt.std.Transform$$anon$4.work(Transform.scala:69)
[error]         at sbt.Execute.$anonfun$submit$2(Execute.scala:283)
[error]         at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:24)
[error]         at sbt.Execute.work(Execute.scala:292)
[error]         at sbt.Execute.$anonfun$submit$1(Execute.scala:283)
[error]         at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error]         at sbt.CompletionService$$anon$2.call(CompletionService.scala:65)
[error]         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error]         at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
[error]         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error]         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[error]         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[error]         at java.base/java.lang.Thread.run(Thread.java:833)
[error] (update) sbt.librarymanagement.ResolveException: Error downloading com.eed3si9n:sbt-assembly;sbtVersion=1.0;scalaVersion=2.12:1.2.0
[error]   not found: https://my.company.com/nexus/repo/com/eed3si9n/sbt-assembly/1.2.0/sbt-assembly-1.2.0.pom
[warn] Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? (default: r)

The error is right in that https://my.company.com/nexus/repo/com/eed3si9n/sbt-assembly/1.2.0/sbt-assembly-1.2.0.pom does not exist.

But where did sbt get the idea of trying that location?

FWIW, the artifact is at https://my.company.com/nexus/repo/com/eed3si9n/sbt-assembly_2.12_1.0/1.2.0/sbt-assembly-1.2.0.pom and I ultimately do want to point sbt to that, but I also want to learn to navigate where sbt is looking for artifacts.

@TomasMikula
Copy link
Author

Sorry, wrong repo. Asked at sbt/sbt#7532

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant