我有一個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 –