sbt 找不到 scripted-sbt 依赖项
sbt cannot find the scripted-sbt dependency
我正在为我的一个项目使用 scripted
sbt 插件,它一直运行良好,但最近突然停止工作,原因不明。这是一个失败的示例设置:
# project/plugins.sbt
libraryDependencies += "org.scala-sbt" % "scripted-plugin" % sbtVersion.value
# build.sbt
scalaVersion := "2.11.6"
scriptedSettings
# project/build.properties
sbt.version=0.13.5
当我执行 sbt update
时,我看到了以下内容。请注意,它下载 scripted-plugin
但找不到 scripted-sbt
。直到最近这一切都很好,只是有点停止了。有什么想法吗?
test$ sbt update
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=1024m; support was removed in 8.0
[info] Loading project definition from /private/tmp/test/project
[info] Updating {file:/private/tmp/test/project/}test-build...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
...
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/scripted-plugin/0.13.5/jars/scripted-plugin.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#scripted-plugin;0.13.5!scripted-plugin.jar (4424ms)
...
[info] Done updating.
[info] Set current project to test (in build file:/private/tmp/test/)
[info] Updating {file:/private/tmp/test/}test...
[info] Resolving org.scala-sbt#scripted-sbt;0.13.5 ...
[warn] module not found: org.scala-sbt#scripted-sbt;0.13.5
[warn] ==== local: tried
[warn] /Users/rnorris/.ivy2/local/org.scala-sbt/scripted-sbt/0.13.5/ivys/ivy.xml
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/org/scala-sbt/scripted-sbt/0.13.5/scripted-sbt-0.13.5.pom
[info] Resolving org.scala-sbt#sbt-launch;0.13.5 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.scala-sbt#scripted-sbt;0.13.5: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
sbt.ResolveException: unresolved dependency: org.scala-sbt#scripted-sbt;0.13.5: not found
at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:217)
at sbt.IvyActions$$anonfun$update.apply(IvyActions.scala:126)
...
[error] (*:update) sbt.ResolveException: unresolved dependency: org.scala-sbt#scripted-sbt;0.13.5: not found
[error] Total time: 2 s, completed Jun 12, 2015 2:13:32 PM
看起来脚本插件只能在 sbt-plugins 存储库中找到。这似乎只有在 sbtPlugin 设置为 true 时才添加。
对您的示例进行以下更改为我提供了一个解决方案:
#build.sbt
sbtPlugin := true
scalaVersion := "2.11.6"
scriptedSettings
输出如下:
sbt update
[info] Loading project definition from /root/test/project
[info] Set current project to test (in build file:/root/test/)
[info] Updating {file:/root/test/}test...
[info] Resolving org.scala-sbt#sbt-launch;0.13.5 ...
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/scripted-sbt/0.13.5/jars/scripted-sbt.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#scripted-sbt;0.13.5!scripted-sbt.jar (1323ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/scripted-framework/0.13.5/jars/scripted-framework.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#scripted-framework;0.13.5!scripted-framework.jar (1365ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/0.13.5/jars/sbt-launch.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#sbt-launch;0.13.5!sbt-launch.jar (2722ms)
[info] Done updating.
[success] Total time: 11 s, completed Jun 16, 2015 5:45:39 AM
请注意,我也用 sbt 0.13.8 尝试过这个并且有完全相同的问题和相同的结果。
编辑:如果设置 sbtPlugin := true
对于这个特定的应用程序没有意义,您可以将 resolvers += Resolver.typesafeIvyRepo("releases")
添加到主 build.sbt 以获得相同的结果。
EDIT2:这也可能是一个问题:resolvers not shared to dependent sbt projects?
我正在为我的一个项目使用 scripted
sbt 插件,它一直运行良好,但最近突然停止工作,原因不明。这是一个失败的示例设置:
# project/plugins.sbt
libraryDependencies += "org.scala-sbt" % "scripted-plugin" % sbtVersion.value
# build.sbt
scalaVersion := "2.11.6"
scriptedSettings
# project/build.properties
sbt.version=0.13.5
当我执行 sbt update
时,我看到了以下内容。请注意,它下载 scripted-plugin
但找不到 scripted-sbt
。直到最近这一切都很好,只是有点停止了。有什么想法吗?
test$ sbt update
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=1024m; support was removed in 8.0
[info] Loading project definition from /private/tmp/test/project
[info] Updating {file:/private/tmp/test/project/}test-build...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
...
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/scripted-plugin/0.13.5/jars/scripted-plugin.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#scripted-plugin;0.13.5!scripted-plugin.jar (4424ms)
...
[info] Done updating.
[info] Set current project to test (in build file:/private/tmp/test/)
[info] Updating {file:/private/tmp/test/}test...
[info] Resolving org.scala-sbt#scripted-sbt;0.13.5 ...
[warn] module not found: org.scala-sbt#scripted-sbt;0.13.5
[warn] ==== local: tried
[warn] /Users/rnorris/.ivy2/local/org.scala-sbt/scripted-sbt/0.13.5/ivys/ivy.xml
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/org/scala-sbt/scripted-sbt/0.13.5/scripted-sbt-0.13.5.pom
[info] Resolving org.scala-sbt#sbt-launch;0.13.5 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.scala-sbt#scripted-sbt;0.13.5: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
sbt.ResolveException: unresolved dependency: org.scala-sbt#scripted-sbt;0.13.5: not found
at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:217)
at sbt.IvyActions$$anonfun$update.apply(IvyActions.scala:126)
...
[error] (*:update) sbt.ResolveException: unresolved dependency: org.scala-sbt#scripted-sbt;0.13.5: not found
[error] Total time: 2 s, completed Jun 12, 2015 2:13:32 PM
看起来脚本插件只能在 sbt-plugins 存储库中找到。这似乎只有在 sbtPlugin 设置为 true 时才添加。
对您的示例进行以下更改为我提供了一个解决方案:
#build.sbt
sbtPlugin := true
scalaVersion := "2.11.6"
scriptedSettings
输出如下:
sbt update
[info] Loading project definition from /root/test/project
[info] Set current project to test (in build file:/root/test/)
[info] Updating {file:/root/test/}test...
[info] Resolving org.scala-sbt#sbt-launch;0.13.5 ...
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/scripted-sbt/0.13.5/jars/scripted-sbt.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#scripted-sbt;0.13.5!scripted-sbt.jar (1323ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/scripted-framework/0.13.5/jars/scripted-framework.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#scripted-framework;0.13.5!scripted-framework.jar (1365ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/0.13.5/jars/sbt-launch.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#sbt-launch;0.13.5!sbt-launch.jar (2722ms)
[info] Done updating.
[success] Total time: 11 s, completed Jun 16, 2015 5:45:39 AM
请注意,我也用 sbt 0.13.8 尝试过这个并且有完全相同的问题和相同的结果。
编辑:如果设置 sbtPlugin := true
对于这个特定的应用程序没有意义,您可以将 resolvers += Resolver.typesafeIvyRepo("releases")
添加到主 build.sbt 以获得相同的结果。
EDIT2:这也可能是一个问题:resolvers not shared to dependent sbt projects?