我有一个ScalaJS项目在IntelliJ中内置了SBT,我想在其中包含一个基于Leaflet库的滑动地图。ScalaJS项目:SBT依赖于传单未解决
我使用ScalaJS版本0.6.19和SBT版本0.13.7
我build.sbt
如下:
import com.lihaoyi.workbench.Plugin.{bootSnippet, updateBrowsers}
enablePlugins(ScalaJSPlugin)
workbenchSettings
name := "WeatherReport"
version := "0.1-SNAPSHOT"
scalaVersion := "2.11.11"
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "0.9.1"
,"org.scala-js" %%% "scalajs-java-time" % "0.2.2"
,"com.lihaoyi" %%% "scalatags" % "0.6.5"
,"org.webjars.npm" %%% "leaflet" % "0.7.7"
)
bootSnippet := "com.sap.demo.WeatherReport().main(document.getElementById('weatherDiv'));"
updateBrowsers <<= updateBrowsers.triggeredBy(fastOptJS in Compile)
这一切,直到我说上leaflet
最后的依赖工作的罚款。现在SBT抱怨:
Error:Error while importing SBT project:
...
[info] Resolving org.eclipse.jetty#jetty-util;8.1.16.v20140903 ...
[info] Resolving org.eclipse.jetty#jetty-io;8.1.16.v20140903 ...
[info] Resolving org.eclipse.jetty#jetty-http;8.1.16.v20140903 ...
[info] Resolving org.eclipse.jetty#jetty-server;8.1.16.v20140903 ...
[info] Resolving org.eclipse.jetty.orbit#javax.servlet;3.0.0.v201112011016 ...
[info] Resolving org.eclipse.jetty#jetty-continuation;8.1.16.v20140903 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.webjars.npm#leaflet_sjs0.6_2.11;0.7.7: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Unresolved dependencies path:
[warn] org.webjars.npm:leaflet_sjs0.6_2.11:0.7.7 (/Developer/Scala/weather-report/build.sbt#L13-19)
[warn] +- weatherreport:weatherreport_sjs0.6_2.11:0.1-SNAPSHOT
[trace] Stack trace suppressed: run 'last *:ssExtractDependencies' for the full output.
[trace] Stack trace suppressed: run 'last *:update' for the full output.
[error] (*:ssExtractDependencies) sbt.ResolveException: unresolved dependency: org.webjars.npm#leaflet_sjs0.6_2.11;0.7.7: not found
[error] (*:update) sbt.ResolveException: unresolved dependency: org.webjars.npm#leaflet_sjs0.6_2.11;0.7.7: not found
[error] Total time: 1 s, completed 31-Aug-2017 10:26:54
由于FAS一个我可以从leaflet entry的WebJars网站上说,我已经得到了组/神器/版本正确的信息。
我不清楚为什么错误消息已将“_sjs0.6_2.11”添加到库名称中。这是因为需要一些特定于ScalaJS的传单版本?
感谢
克里斯W¯¯
谢谢你,但我仍然在这里失去了一些东西。 现在,我已经添加了jsDependencies行,我收到其他错误消息说: [提醒] \t注:未解决的依赖路径: [提醒] \t \t org.webjars.npm:传单:0.7.7 ( (org.scalajs.sbtplugin.ScalaJSPluginInternal)ScalaJSPluginInternal.scala#L996) [警告] \t \t + - weatherreport:weatherreport_sjs0.6_2.11:0.1-SNAPSHOT 然而,用于单页的POM文件存在于Maven的https://开头repo1.maven.org/maven2/org/webjars/npm/leaflet/0.7.7/leaflet-0.7.7.pom –
不,对不起。这是(not-so-)IntelliJ中的代理问题。如果我从我的公司VPN断开连接并将IntelliJ设置为无代理,那么它可以工作... Grrrr –