首页 > 解决方案 > sbt无法同步项目,因为无法编译

问题描述

我还处于初学者水平,所以我很乐意接受一些帮助来解决这个问题......

我正在使用 IntelliJ IDEA 2018.2.5 Sbt 版本:1.2.6 JDK 版本:1.8.0_191-b12 Scala 用作 IntelliJ 插件(最新)。

当我使用 InteliJ 加载从 coursera 网页下载的 sbt 项目时,项目没有同步,我看到很多错误消息。build.sbt 中的行也是红色的。我已经复制了错误消息和 build.sbt 的行。

以下是错误消息。由于链接的最大限制,该列表不完整:

导入 sbt 项目时出错:

;reload; set root.org.jetbrains.sbt.StructureKeys.sbtStructureOptions in 
Global := "download resolveClassifiers resolveSbtClassifiers" 
;/:dumpStructureTo C:/Users/KOMPOS~1/AppData/Local/Temp/sbt-structure2.xml; 
session clear-all [info] Loading global plugins from C:\Users\Komposzt 
f┼Ĺkapit├íny.sbt\0.13\plugins [info] Loading project definition from 
C:\Users\Komposzt f┼Ĺkapit├íny\Desktop\example 1\project [info] Set 
current project to progfun1-example (in build 
file:/C:/Users/Komposzt%20f%C5%91kapit%C3%A1ny/Desktop/example%201/) [info] 
Defining /:sbtStructureOptions
[info] The new value will be used by /:ssOptions
[info] Reapplying settings...
[info] Set current project to progfun1-example (in build
file:/C:/Users/Komposzt%20f%C5%91kapit%C3%A1ny/Desktop/example%201/)
Downloading https://repo1.maven.org/maven2/org/scala-lang/modules/scala- 
parser-combinators_2.12/1.1.1/scala-parser-combinators_2.12-1.1.1.pom.sha1 
Downloading https://repo1.maven.org/maven2/junit/junit/4.12/junit- 
4.12.pom.sha1 
Downloading https://repo1.maven.org/maven2/org/scalatest/scalatest_2.12/2.2.6/scalatest_2.12-2.2.6.pom

Downloading https://repo1.maven.org/maven2/org/scala-lang/scala- 
library/2.12.7/scala-library-2.12.7.pom.sha1
Downloading https://repo1.maven.org/maven2/junit/junit/4.12/junit-4.12.pom
Downloading https://repo1.maven.org/maven2/org/scala-lang/modules/scala- 
parser-combinators_2.12/1.1.1/scala-parser-combinators_2.12-1.1.1.pom
Downloading https://repo1.maven.org/maven2/org/scalatest/scalatest_2.12/2.2.6/scalatest_2.12-2.2.6.pom.sha1
Downloading https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.12.7/scala-ibrary-2.12.7.pom

[trace] Stack trace suppressed: run last *:ssExtractDependencies for the 
full output. [trace] Stack trace suppressed: run last 
*:coursierSbtClassifiersResolution for the full output.
[trace] Stack trace suppressed: run last :coursierResolutions for the full 
output.
[error] (:ssExtractDependencies) coursier.ResolutionException: Exception 
during resolution
[error] (:coursierSbtClassifiersResolution) coursier.ResolutionException: 
Exception during resolution
[error] (:coursierResolutions) coursier.ResolutionException: Exception 
during resolution
[error] Total time: 2 s, completed 2018.10.22. 13:08:00

build.sbt 内容:

name := course.value + "-" + assignment.value

scalaVersion := "2.12.7"

libraryDependencies += "org.scalatest" %% "scalatest_2.11" % "3.0.5" % 
"test"

scalacOptions ++= Seq("-deprecation")

// grading libraries libraryDependencies += "junit" % "junit" % "4.12" % 
Test

// for funsets libraryDependencies += "org.scala-lang.modules" %% "scala- 
parser-combinators" % "1.1.1"

// include the common dir commonSourcePackages += "common"

courseId := "bRPXgjY9EeW6RApRXdjJPw"

标签: scalaintellij-ideasbtcoursera-api

解决方案


推荐阅读