尝试将scala play项目导入Intellij时,我收到以下错误。
我使用以下种子创建了一个项目:
sbt new playframework/play-scala-seed.g8
它从命令行编译并运行良好。
然而,当我尝试将项目导入Intellij时,IDE禁止使用以下内容:
Error while importing sbt project:
[info] Loading settings from plugins.sbt,scaffold.sbt ...
[info] Loading project definition from /home/x/IdeaProjects/p3/u/project
[info] Loading settings from build.sbt ...
[info] Set current project to user (in build file:/home/x/IdeaProjects/p3/u/)
[info] sbt server started at 127.0.0.1:4315
[user] $
[info] Defining */*:sbtStructureOptions, */*:sbtStructureOutputFile, *:shellPrompt
[info] The new values will be used by no settings or tasks.
[info] Reapplying settings...
[info] Set current project to user (in build file:/home/x/IdeaProjects/p3/u/)
[info] Applying State transformations org.jetbrains.sbt.CreateTasks from /home/x/.IdeaIC2017.3/config/plugins/Scala/launcher/sbt-structure-1.0.jar
[info] Reapplying settings...
[info] Set current project to user (in build file:/home/x/IdeaProjects/p3/user/)
[warn] Detected merged artifact: [FAILED ] com.typesafe.sbt#sbt-native-packager;1.3.2!sbt-native-packager.jar(src): (0ms).
[warn] Detected merged artifact: [FAILED ] com.typesafe.sbt#sbt-web;1.4.3!sbt-web.jar(doc): (0ms).
[warn] ==== local: tried
[warn] ==== local: tried
[warn] /home/x/.ivy2/local/com.typesafe.sbt/sbt-web/scala_2.12/sbt_1.0/1.4.3/docs/sbt-web-javadoc.jar
[warn] /home/x/.ivy2/local/com.typesafe.sbt/sbt-native-packager/scala_2.12/sbt_1.0/1.3.2/srcs/sbt-native-packager-sources.jar
[warn] ==== public: tried
[warn] ==== public: tried
[warn] https://repo1.maven.org/maven2/com/typesafe/sbt/sbt-web_2.12_1.0/1.4.3/sbt-web-1.4.3-javadoc.jar
[warn] https://repo1.maven.org/maven2/com/typesafe/sbt/sbt-native-packager_2.12_1.0/1.3.2/sbt-native-packager-1.3.2-sources.jar
[warn] ==== local-preloaded-ivy: tried
[warn] ==== local-preloaded-ivy: tried
[warn] /home/x/.sbt/preloaded/com.typesafe.sbt/sbt-web/1.4.3/docs/sbt-web-javadoc.jar
[warn] /home/x/.sbt/preloaded/com.typesafe.sbt/sbt-native-packager/1.3.2/srcs/sbt-native-packager-sources.jar
[warn] ==== local-preloaded: tried
[warn] ==== local-preloaded: tried
[warn] file:////home/x/.sbt/preloaded/com/typesafe/sbt/sbt-web_2.12_1.0/1.4.3/sbt-web-1.4.3-javadoc.jar
[warn] file:////home/x/.sbt/preloaded/com/typesafe/sbt/sbt-native-packager_2.12_1.0/1.3.2/sbt-native-packager-1.3.2-sources.jar
[warn] Detected merged artifact: [FAILED ] com.typesafe.sbt#sbt-web;1.4.3!sbt-web.jar(src): (0ms).
[warn] Detected merged artifact: [FAILED ] com.typesafe.sbt#sbt-native-packager;1.3.2!sbt-native-packager.jar(doc): (0ms).
[warn] ==== local: tried
[warn] ==== local: tried
[warn] /home/x/.ivy2/local/com.typesafe.sbt/sbt-web/scala_2.12/sbt_1.0/1.4.3/srcs/sbt-web-sources.jar
[warn] ==== public: tried
[warn] /home/x/.ivy2/local/com.typesafe.sbt/sbt-native-packager/scala_2.12/sbt_1.0/1.3.2/docs/sbt-native-packager-javadoc.jar
[warn] https://repo1.maven.org/maven2/com/typesafe/sbt/sbt-web_2.12_1.0/1.4.3/sbt-web-1.4.3-sources.jar
[warn] ==== public: tried
[warn] ==== local-preloaded-ivy: tried
[warn] https://repo1.maven.org/maven2/com/typesafe/sbt/sbt-native-packager_2.12_1.0/1.3.2/sbt-native-packager-1.3.2-javadoc.jar
[warn] /home/x/.sbt/preloaded/com.typesafe.sbt/sbt-web/1.4.3/srcs/sbt-web-sources.jar
[warn] ==== local-preloaded-ivy: tried
[warn] ==== local-preloaded: tried
[warn] /home/x/.sbt/preloaded/com.typesafe.sbt/sbt-native-packager/1.3.2/docs/sbt-native-packager-javadoc.jar
[warn] file:////home/x/.sbt/preloaded/com/typesafe/sbt/sbt-web_2.12_1.0/1.4.3/sbt-web-1.4.3-sources.jar
[warn] ==== local-preloaded: tried
[warn] file:////home/x/.sbt/preloaded/com/typesafe/sbt/sbt-native-packager_2.12_1.0/1.3.2/sbt-native-packager-1.3.2-javadoc.jar
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: FAILED DOWNLOADS ::
[warn] :: ^ see resolution messages for details ^ ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.typesafe.sbt#sbt-native-packager;1.3.2!sbt-native-packager.jar(src)
[warn] :: com.typesafe.sbt#sbt-native-packager;1.3.2!sbt-native-packager.jar(doc)
[warn] :: com.typesafe.sbt#sbt-web;1.4.3!sbt-web.jar(doc)
[warn] :: com.typesafe.sbt#sbt-web;1.4.3!sbt-web.jar(src)
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[error] sbt.librarymanagement.ResolveException: download failed: com.typesafe.sbt#sbt-native-packager;1.3.2!sbt-native-packager.jar(src)
[error] download failed: com.typesafe.sbt#sbt-native-packager;1.3.2!sbt-native-packager.jar(doc)
[error] download failed: com.typesafe.sbt#sbt-web;1.4.3!sbt-web.jar(doc)
[error] download failed: com.typesafe.sbt#sbt-web;1.4.3!sbt-web.jar(src)
[error] at sbt.internal.librarymanagement.IvyActions$.resolveAndRetrieve(IvyActions.scala:331)
[error] at sbt.internal.librarymanagement.IvyActions$.$anonfun$updateEither$1(IvyActions.scala:205)
[error] at sbt.internal.librarymanagement.IvySbt$Module.$anonfun$withModule$1(Ivy.scala:243)
[error] at sbt.internal.librarymanagement.IvySbt.$anonfun$withIvy$1(Ivy.scala:204)
[error] at sbt.internal.librarymanagement.IvySbt.sbt$internal$librarymanagement$IvySbt$$action$1(Ivy.scala:70)
[error] at sbt.internal.librarymanagement.IvySbt$$anon$3.call(Ivy.scala:77)
[error] at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:93)
[error] at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:78)
[error] at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:97)
[error] at xsbt.boot.Using$.withResource(Using.scala:10)
[error] at xsbt.boot.Using$.apply(Using.scala:9)
[error] at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:58)
[error] at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:48)
[error] at xsbt.boot.Locks$.apply0(Locks.scala:31)
[error] at xsbt.boot.Locks$.apply(Locks.scala:28)
[error] at sbt.internal.librarymanagement.IvySbt.withDefaultLogger(Ivy.scala:77)
[error] at sbt.internal.librarymanagement.IvySbt.withIvy(Ivy.scala:199)
[error] at sbt.internal.librarymanagement.IvySbt.withIvy(Ivy.scala:196)
[error] at sbt.internal.librarymanagement.IvySbt$Module.withModule(Ivy.scala:242)
[error] at sbt.internal.librarymanagement.IvyActions$.updateEither(IvyActions.scala:190)
[error] at sbt.librarymanagement.ivy.IvyDependencyResolution.update(IvyDependencyResolution.scala:20)
[error] at sbt.librarymanagement.DependencyResolution.update(DependencyResolution.scala:56)
[error] at sbt.internal.LibraryManagement$.transitiveScratch(LibraryManagement.scala:135)
[error] at sbt.Classpaths$.$anonfun$sbtClassifiersTasks$12(Defaults.scala:2178)
[error] at sbt.Classpaths$$anon$4.call(Defaults.scala:2256)
[error] at sbt.Classpaths$$anon$4.call(Defaults.scala:2249)
[error] at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:93)
[error] at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:78)
[error] at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:97)
[error] at xsbt.boot.Using$.withResource(Using.scala:10)
[error] at xsbt.boot.Using$.apply(Using.scala:9)
[error] at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:58)
[error] at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:48)
[error] at xsbt.boot.Locks$.apply0(Locks.scala:31)
[error] at xsbt.boot.Locks$.apply(Locks.scala:28)
[error] at sbt.Classpaths$.withExcludes(Defaults.scala:2249)
[error] at sbt.Classpaths$.$anonfun$sbtClassifiersTasks$10(Defaults.scala:2165)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:42)
[error] at sbt.std.Transform$$anon$4.work(System.scala:64)
[error] at sbt.Execute.$anonfun$submit$2(Execute.scala:257)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] at sbt.Execute.work(Execute.scala:266)
[error] at sbt.Execute.$anonfun$submit$1(Execute.scala:257)
[error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:167)
[error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:32)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] at java.lang.Thread.run(Thread.java:748)
[error] (*:updateSbtClassifiers) sbt.librarymanagement.ResolveException: download failed: com.typesafe.sbt#sbt-native-packager;1.3.2!sbt-native-packager.jar(src)
[error] download failed: com.typesafe.sbt#sbt-native-packager;1.3.2!sbt-native-packager.jar(doc)
[error] download failed: com.typesafe.sbt#sbt-web;1.4.3!sbt-web.jar(doc)
[error] download failed: com.typesafe.sbt#sbt-web;1.4.3!sbt-web.jar(src)
[error] Total time: 8 s, completed 26-Jan-2018 22:39:24
[INFO] [01/26/2018 22:39:24.162] [Thread-4] [CoordinatedShutdown(akka://sbt-web)] Starting coordinated shutdown from JVM shutdown hook
任何想法如何解决这个问题?在Arch Linux上使用此版本的Intellij
IntelliJ IDEA社区版(intellij-idea-community-edition)2:2017.3.3-1
答案 0 :(得分:9)
添加了此功能,现在可以使用了:
resolvers += Resolver.sbtPluginRepo("releases")
根据这些说明: