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

Already on GitHub? Sign in to your account

Incorrect classpath when artifacts differ only by classifier #419

Closed
harrah opened this Issue Jan 5, 2013 · 1 comment

Comments

Projects
None yet
1 participant
Owner

harrah commented Jan 5, 2013

Adding different classifiers of the same artifact as libraryDependencies, only the last one is included in external-dependency-classpath:

$ cat build.sbt 
libraryDependencies += "com.github.scala-incubator.io" %% "scala-io-core" % "0.3.0" 

libraryDependencies += "com.github.scala-incubator.io" %% "scala-io-core" % "0.3.0" classifier "test"
$ sbt11 'show external-dependency-classpath'
[info] Set current project to default-d0f036 (in build file:/private/tmp/)
[info] ArrayBuffer(Attributed(/Users/mpe/.sbt/boot/scala-2.9.1/lib/scala-library.jar), Attributed(/Users/mpe/.ivy2/cache/com.github.scala-incubator.io/scala-io-core_2.9.1/jars/scala-io-core_2.9.1-0.3.0-test.jar), Attributed(/Users/mpe/.ivy2/cache/com.github.jsuereth.scala-arm/scala-arm_2.9.1/jars/scala-arm_2.9.1-1.1.jar))
[success] Total time: 0 s, completed Apr 6, 2012 12:28:25 AM
$ 

In the above case, only 'scala-io-core_2.9.1-0.3.0-test.jar' ends up in classpath.

I can get both jars into classpath by moving 'test' classified artifact to 'test' configuration and adding withSources() to non-classified one:

$ cat build.sbt 
libraryDependencies += "com.github.scala-incubator.io" %% "scala-io-core" % "0.3.0" withSources()

libraryDependencies += "com.github.scala-incubator.io" %% "scala-io-core" % "0.3.0" % "test" classifier "test"
$ sbt11 'show test:external-dependency-classpath'
[info] Set current project to default-d0f036 (in build file:/private/tmp/)
[info] ArrayBuffer(Attributed(/Users/mpe/.sbt/boot/scala-2.9.1/lib/scala-library.jar), Attributed(/Users/mpe/.ivy2/cache/com.github.scala-incubator.io/scala-io-core_2.9.1/jars/scala-io-core_2.9.1-0.3.0-test.jar), Attributed(/Users/mpe/.ivy2/cache/com.github.scala-incubator.io/scala-io-core_2.9.1/jars/scala-io-core_2.9.1-0.3.0.jar), Attributed(/Users/mpe/.ivy2/cache/com.github.jsuereth.scala-arm/scala-arm_2.9.1/jars/scala-arm_2.9.1-1.1.jar))
[success] Total time: 0 s, completed Apr 6, 2012 12:42:10 AM
$ 
Owner

harrah commented Jan 5, 2013

IMPORTANT This project has moved to https://github.com/sbt/sbt. This issue still exists to avoid dead links, but GitHub limitations prevent the original issue from being correctly preserved here. Please see sbt/sbt#419 for the full issue and to comment.

@harrah harrah closed this Jan 5, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment