harrah/xsbt — Issue #285: Sbt does not resolve dependencies with classifiers.
Author: Lexxn
Created: 2011-11-29 20:26:28+00:00
State: open

There are multiple problems here. First of all, having "org.lwjgl.lwjgl" % "lwjgl-platform" % lwjglVersion" should be enough to download all the artifacts. But it does not work.

Having failed that, manually putting all the artifact as a dependencies also fails, because only one of those is downloaded and the rest is ignored. The choise appears to be arbitrary.
Surpisingly listing only one artifact works.

Here is the build:

import sbt._
import Keys._

object MyBuild extends Build {

val lwjglVersion = "2.8.2"

lazy val broken = Project(
id = "broken",
base = file("."),
settings = Defaults.defaultSettings ++ Seq(
scalaVersion := "2.9.1",
target := new File("target/broken"),
libraryDependencies += "org.lwjgl.lwjgl" % "lwjgl-platform" % lwjglVersion classifier "natives-windows",
libraryDependencies += "org.lwjgl.lwjgl" % "lwjgl-platform" % lwjglVersion classifier "natives-linux",
libraryDependencies += "org.lwjgl.lwjgl" % "lwjgl-platform" % lwjglVersion classifier "natives-osx"
)
)

lazy val working = Project(
id = "working",
base = file("."),
settings = Defaults.defaultSettings ++ Seq(
scalaVersion := "2.9.1",
target := new File("target/working"),
libraryDependencies += "org.lwjgl.lwjgl" % "lwjgl-platform" % lwjglVersion classifier "natives-linux"
)
)
}