以下简单的SBT无法导入org.lwjglx
/ lwjgl3-awt
:
name := "LWJGLTest"
version := "0.1"
scalaVersion := "2.12.8"
libraryDependencies += "org.lwjglx" % "lwjgl3-awt" % "0.1.5"
错误是:
[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
这是SBT还是lwjgl3-awt
工件的问题?有什么方法可以解决它吗?
为进行比较,以下sbt可以很好地加载:
name := "LWJGLTest"
version := "0.1"
scalaVersion := "2.12.8"
libraryDependencies += "org.lwjgl" % "lwjgl" % "3.2.2"
libraryDependencies += "org.lwjgl" % "lwjgl-opengl" % "3.2.2"
答案 0 :(得分:1)
以下解决方法允许通过手动指定必要的依赖项来继续进行操作:
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")
我认为问题是SBT某种程度上无法理解${platform}
中的pom.xml
。上面的解决方案阻止它尝试解决这些依赖关系,这就是为什么要明确提供它们的原因。