Skip to content

Scopes and artifacts in sbt #2431

@romanowski

Description

@romanowski

Steps:
Small repro can be found here: https://github.com/romanowski/sbt-problems/tree/artifact-resolve-problem

Problem:

// following lines cannot be resolved
libraryDependencies += "a" % "b" % "1.0.0" % "compile->runtime" artifacts(Artifact("b1", "jar", "jar"))

libraryDependencies += "a" % "b" % "1.0.0" % "test->runtime" artifacts(Artifact("b1", "jar", "jar"))

// however changing this to code below fixes problem
libraryDependencies += "a" % "b" % "1.0.0" % "compile,test->runtime" artifacts(Artifact("b1", "jar", "jar"))

This happens only when artifacts are present. For some reason sbt tries to download "b.jar" (in general "[module].jar"

Output:

[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[warn]  [FAILED     ] a#b;1.0.0!b.jar:  (0ms)
[warn] ==== local: tried
[warn]   /home/krzysiek/.ivy2/local/a/b/1.0.0/jars/b.jar
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/a/b/1.0.0/b-1.0.0.jar
[warn] ==== buggy: tried
[warn]   /home/krzysiek/ivy-repo/repo/a/b/1.0.0/b.jar
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::              FAILED DOWNLOADS            ::
[warn]  :: ^ see resolution messages for details  ^ ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: a#b;1.0.0!b.jar

Expectations
Sbt should handle both ways of configuring scopes (in case of artifacts are present)

Metadata

Metadata

Assignees

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