-1

Following simple SBT fails to import org.lwjglx / lwjgl3-awt:

name := "LWJGLTest"

version := "0.1"

scalaVersion := "2.12.8"

libraryDependencies += "org.lwjglx" % "lwjgl3-awt" % "0.1.5"

The error is:

[warn]  Detected merged artifact: [FAILED     ] org.lwjgl#lwjgl-opengl;3.2.2!lwjgl-opengl.jar:  (0ms).
[warn]  Detected merged artifact: [FAILED     ] org.lwjgl#lwjgl;3.2.2!lwjgl.jar:  (0ms).
[warn] ==== public: tried
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/org/lwjgl/lwjgl-opengl/3.2.2/lwjgl-opengl-3.2.2-natives-${platform}.jar
[warn]   https://repo1.maven.org/maven2/org/lwjgl/lwjgl/3.2.2/lwjgl-3.2.2-natives-${platform}.jar
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::              FAILED DOWNLOADS            ::
[warn]  :: ^ see resolution messages for details  ^ ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.lwjgl#lwjgl;3.2.2!lwjgl.jar
[warn]  :: org.lwjgl#lwjgl-opengl;3.2.2!lwjgl-opengl.jar
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[error] sbt.librarymanagement.ResolveException: download failed: org.lwjgl#lwjgl;3.2.2!lwjgl.jar
[error] download failed: org.lwjgl#lwjgl-opengl;3.2.2!lwjgl-opengl.jar

Is this an issue with SBT, or with the lwjgl3-awt artifact? Is there some way how to work around it?

For a comparison, following sbt loads fine:

name := "LWJGLTest"

version := "0.1"

scalaVersion := "2.12.8"

libraryDependencies += "org.lwjgl" % "lwjgl" % "3.2.2"

libraryDependencies += "org.lwjgl" % "lwjgl-opengl" % "3.2.2"
Suma
  • 33,181
  • 16
  • 123
  • 191
  • *lwjglx* seems to be unmaintained/unofficial. You should definitely use `"org.lwjgl" % "lwjgl-jawt" % "3.2.2"` instead. – Markus Appel Jun 26 '19 at 13:12
  • I am afraid `lwjgl-jawt` does not contain the classes implemented in `lwjglx` (like `AWTGLCanvas` and `PlatformGLCanvas`). The `lwjglx` might be unofficial, but this functionality does not seem to be provided by the official distribution. – Suma Jun 26 '19 at 13:49
  • Then I don't know. The problem is that the library depends on the natives of the two `lwjgl` - libraries, which can be defined in SBT, but the dependency or `lwjglx` does not seem to defined which natives. – Markus Appel Jun 26 '19 at 14:40
  • Maybe [this old answer of mine](https://stackoverflow.com/questions/24222360/cant-get-lwjgl-to-run-using-idea-and-sbt/50735484#50735484) helps you. – Markus Appel Jun 26 '19 at 14:41
  • I think this is more or less a duplicate of [sbt: How do I resolve Maven dependencies that uses Maven properties](https://stackoverflow.com/questions/46763741/sbt-how-do-i-resolve-maven-dependencies-that-uses-maven-properties) – Suma Jun 26 '19 at 15:02
  • That question is about Maven properties, the one I answered about classifiers. – Markus Appel Jun 26 '19 at 15:59

1 Answers1

0

Following workaround allows to proceed by specifying the necessary dependencies manually:

libraryDependencies += "org.lwjgl" % "lwjgl" % "3.2.2"

libraryDependencies += "org.lwjgl" % "lwjgl-opengl" % "3.2.2"

libraryDependencies += "org.lwjglx" % "lwjgl3-awt" % "0.1.5" excludeAll ExclusionRule("org.lwjgl")

I think the problem is SBT somehow does not understand the ${platform} in the pom.xml. The solution above prevents it trying to resolve those dependencies, which is why they are provided explicitly.

Suma
  • 33,181
  • 16
  • 123
  • 191
  • Please share if it actually works. I am pretty sure to run your program you will still need the natives that SBT could not find. – Markus Appel Jun 26 '19 at 15:04
  • Yes, it actually works. The natives were already working for me before, I already had the "org.lwjgl" dependencies. What did not work was adding a "org.lwjglx" dependency. – Suma Jun 26 '19 at 15:07
  • Okay cool. Thanks for sharing. You can accept your own answer btw. – Markus Appel Jun 26 '19 at 15:57