使用Scala和SBT设置IntelliJ

时间:2017-05-23 19:21:38

标签: scala intellij-idea sbt

我正在尝试使用scala和sbt设置intellij进行开发。我已经在IDE上安装了scala和SBT插件。但是,当我尝试创建新的scala和sbt项目时,build.sbt文件显示以下错误:

Cannot resolve symbol :=
Cannot resolve symbol name
Cannot resolve symbol version
Cannot resolve symbol scalaVersion

这是我的build.sbt文件,它由IDE本身创建:

name := "setup"

version := "1.0"

scalaVersion := "2.12.2"

以下是我为创建项目所遵循的步骤:

第一步:文件 - >新项目

第二步:从左侧面板中选择Scala,在右侧面板上选择SBT(即基于SBT的Scala项目),然后单击“下一步”。

第三步:填写项目详细信息,然后单击“完成”。 (Scala版本 - > 2.12.2,SBT版本 - > 0.13.13)

IntelliJ版本 - IntelliJ IDEA 2017.1.3

修改

每当我尝试创建新项目时,都会收到以下错误:

Error:Error while importing SBT project:<br/>...<br/><pre>    https://repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.11/jansi-1.11.jar

        ::::::::::::::::::::::::::::::::::::::::::::::

        ::          UNRESOLVED DEPENDENCIES         ::

        ::::::::::::::::::::::::::::::::::::::::::::::

        :: org.fusesource.jansi#jansi;1.11: not found

        ::::::::::::::::::::::::::::::::::::::::::::::



:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
unresolved dependency: org.fusesource.jansi#jansi;1.11: not found
Error during sbt execution: Error retrieving required libraries
  (see C:\Users\xxxxxx\.sbt\boot\update.log for complete log)
Error: Could not retrieve jansi 1.11
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=384M; support was removed in 8.0</pre><br/>See complete log in <a href="C:\Users\xxxxx\.IntelliJIdea2016.2\system\log\sbt.last.log">C:\Users\xxxxx\.IntelliJIdea2016.2\system\log\sbt.last.log</a>

日志文件包含以下内容:

Getting org.fusesource.jansi jansi 1.11 ...
You probably access the destination server through a proxy server that is not well configured.
You probably access the destination server through a proxy server that is not well configured.
You probably access the destination server through a proxy server that is not well configured.
You probably access the destination server through a proxy server that is not well configured.
You probably access the destination server through a proxy server that is not well configured.
:: problems summary ::
:::: WARNINGS
    Host jcenter.bintray.com not found. url=https://jcenter.bintray.com/org/fusesource/jansi/jansi/1.11/jansi-1.11.pom
    Host jcenter.bintray.com not found. url=https://jcenter.bintray.com/org/fusesource/jansi/jansi/1.11/jansi-1.11.jar
    Host repo.typesafe.com not found. url=https://repo.typesafe.com/typesafe/ivy-releases/org.fusesource.jansi/jansi/1.11/ivys/ivy.xml
    Host repo1.maven.org not found. url=https://repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.11/

** 所以我认为这是我的代理设置的问题,我肯定需要使用代理。有没有办法解决这个问题?

任何帮助将不胜感激。谢谢。

0 个答案:

没有答案