在IntelliJ IDEA中创建Scala项目时的问题

ugmeyewa  于 2023-10-15  发布在  IntelliJ IDEA
关注(0)|答案(3)|浏览(142)

因此,我一直在尝试在IntelliJ IDEA中使用SBT创建Scala项目。我已经下载了JetBrains Scala插件。我的系统需要一个代理来连接到互联网,我已经在IntelliJ IDEA代理设置中设置了代理,我还设置了所有环境变量JAVA_HOME,SCALA_HOME,HTTP_PROXY
请让我知道如果我错过了什么
堆栈跟踪随附在下面。

[info] Loading project definition from D:\Java\Scala\Coursera\HelloTest03\project
[info] Set current project to HelloTest03 (in build file:/D:/Java/Scala/Coursera/HelloTest03/)
[info] Defining *:shellPrompt
[info] The new value will be used by no settings or tasks.
[info] Reapplying settings...
[info] Set current project to HelloTest03 (in build file:/D:/Java/Scala/Coursera/HelloTest03/)
[info] Defining */*:sbtStructureOutputFile
[info] The new value will be used by no settings or tasks.
[info] Reapplying settings...
[info] Set current project to HelloTest03 (in build file:/D:/Java/Scala/Coursera/HelloTest03/)
[info] Defining */*:sbtStructureOptions
[info] The new value will be used by no settings or tasks.
[info] Reapplying settings...
[info] Set current project to HelloTest03 (in build file:/D:/Java/Scala/Coursera/HelloTest03/)
[info] Applying State transformations org.jetbrains.sbt.CreateTasks from C:/Users/973855/.IdeaIC2016.3/config/plugins/Scala/launcher/sbt-structure-0.13.jar
[info] Reapplying settings...
[info] Set current project to HelloTest03 (in build file:/D:/Java/Scala/Coursera/HelloTest03/)
[info] Resolving org.scala-sbt#sbt;0.13.13 ...
[info] Resolving org.scala-lang#scala-library;2.10.6 ...
[info] Resolving org.scala-sbt#main;0.13.13 ...
[info] Resolving org.scala-sbt#actions;0.13.13 ...
[info] Resolving org.scala-sbt#classpath;0.13.13 ...
[info] Updating {file:/D:/Java/Scala/Coursera/HelloTest03/}hellotest03...
[info] Resolving org.scala-lang#scala-compiler;2.10.6 ...
[info] Resolving org.scala-lang#scala-reflect;2.10.6 ...
[info] Resolving org.scala-sbt#interface;0.13.13 ...
[info] Resolving org.scala-sbt#io;0.13.13 ...
[info] Resolving org.scala-sbt#control;0.13.13 ...
[info] Resolving org.scala-sbt#launcher-interface;1.0.0-M1 ...
[info] Resolving org.scala-sbt#completion;0.13.13 ...
[info] Resolving org.scala-sbt#collections;0.13.13 ...
[info] Resolving jline#jline;2.13 ...
[info] Resolving org.fusesource.jansi#jansi;1.11 ...
[info] Resolving org.scala-sbt#api;0.13.13 ...
[info] Resolving org.scala-sbt#classfile;0.13.13 ...
[info] Resolving org.scala-sbt#logging;0.13.13 ...
[info] Resolving org.scala-sbt#process;0.13.13 ...
[info] Resolving org.scala-sbt#compiler-integration;0.13.13 ...
[info] Resolving org.scala-sbt#incremental-compiler;0.13.13 ...
[info] Resolving org.scala-sbt#relation;0.13.13 ...
[info] Resolving org.scala-sbt#compile;0.13.13 ...
[info] Resolving org.scala-sbt#persist;0.13.13 ...
[info] Resolving org.scala-tools.sbinary#sbinary_2.10;0.4.2 ...
[info] Resolving org.scala-sbt#compiler-ivy-integration;0.13.13 ...
[info] Resolving org.scala-sbt#ivy;0.13.13 ...
[info] Resolving org.scala-sbt#cross;0.13.13 ...
[info] Resolving org.scala-sbt.ivy#ivy;2.3.0-sbt-2cf13e211b2cb31f0d3b317289dca70eca3362f6 ...
[info] Resolving com.jcraft#jsch;0.1.50 ...
[info] Resolving org.scala-sbt#serialization_2.10;0.1.2 ...
[info] Resolving org.scala-lang.modules#scala-pickling_2.10;0.10.1 ...
[info] Resolving org.scalamacros#quasiquotes_2.10;2.0.1 ...
[info] Resolving org.json4s#json4s-core_2.10;3.2.10 ...
[info] Resolving org.json4s#json4s-ast_2.10;3.2.10 ...
[info] Resolving com.thoughtworks.paranamer#paranamer;2.6 ...
[info] Resolving org.spire-math#jawn-parser_2.10;0.6.0 ...
[info] Resolving org.spire-math#json4s-support_2.10;0.6.0 ...
[info] Resolving org.scala-sbt#run;0.13.13 ...
[info] Resolving org.scala-sbt#task-system;0.13.13 ...
[info] Resolving org.scala-sbt#tasks;0.13.13 ...
[info] Resolving org.scala-sbt#tracking;0.13.13 ...
[info] Resolving org.scala-sbt#cache;0.13.13 ...
[info] Resolving org.scala-sbt#testing;0.13.13 ...
[info] Resolving org.scala-sbt#test-agent;0.13.13 ...
[info] Resolving org.scala-sbt#test-interface;1.0 ...
[info] Resolving org.scala-sbt#main-settings;0.13.13 ...
[info] Resolving org.scala-sbt#apply-macro;0.13.13 ...
[info] Resolving org.scala-sbt#command;0.13.13 ...
[info] Resolving org.scala-sbt#template-resolver;0.1 ...
[info] Resolving org.scala-sbt#logic;0.13.13 ...
[info] Resolving org.scala-sbt#compiler-interface;0.13.13 ...
[info] Resolving org.scala-lang#scala-library;2.12.1 ...
[info] Resolving org.scala-lang#scala-library;2.12.1 ...
[warn] Host repo1.maven.org not found. url=https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.12.1/scala-library-2.12.1.pom
[info] You probably access the destination server through a proxy server that is not well configured.
[warn]  module not found: org.scala-lang#scala-library;2.12.1
[warn] ==== local: tried
[warn]   C:\Users\973855\.ivy2\local\org.scala-lang\scala-library\2.12.1\ivys\ivy.xml
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.12.1/scala-library-2.12.1.pom
[warn] ==== activator-launcher-local: tried
[warn]   C:\Users\973855\.activator\repository\org.scala-lang\scala-library\2.12.1\ivys\ivy.xml
[warn] ==== activator-local: tried
[warn]   D:\Java\Scala\activator-dist-1.3.12\repository\org.scala-lang\scala-library\2.12.1\ivys\ivy.xml
[warn] ==== typesafe-releases: tried
[warn]   http://repo.typesafe.com/typesafe/releases/org/scala-lang/scala-library/2.12.1/scala-library-2.12.1.pom
[warn] ==== typesafe-ivy-releasez: tried
[warn]   http://repo.typesafe.com/typesafe/ivy-releases/org.scala-lang/scala-library/2.12.1/ivys/ivy.xml
[info] Resolving org.scala-lang#scala-compiler;2.12.1 ...
[info] Resolving org.scala-lang#scala-compiler;2.12.1 ...
[warn] Host repo1.maven.org not found. url=https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.12.1/scala-compiler-2.12.1.pom
[info] You probably access the destination server through a proxy server that is not well configured.
[warn]  module not found: org.scala-lang#scala-compiler;2.12.1
[warn] ==== local: tried
[warn]   C:\Users\973855\.ivy2\local\org.scala-lang\scala-compiler\2.12.1\ivys\ivy.xml
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.12.1/scala-compiler-2.12.1.pom
[warn] ==== activator-launcher-local: tried
[warn]   C:\Users\973855\.activator\repository\org.scala-lang\scala-compiler\2.12.1\ivys\ivy.xml
[warn] ==== activator-local: tried
[warn]   D:\Java\Scala\activator-dist-1.3.12\repository\org.scala-lang\scala-compiler\2.12.1\ivys\ivy.xml
[warn] ==== typesafe-releases: tried
[warn]   http://repo.typesafe.com/typesafe/releases/org/scala-lang/scala-compiler/2.12.1/scala-compiler-2.12.1.pom
[warn] ==== typesafe-ivy-releasez: tried
[warn]   http://repo.typesafe.com/typesafe/ivy-releases/org.scala-lang/scala-compiler/2.12.1/ivys/ivy.xml
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.scala-lang#scala-library;2.12.1: not found
[warn]  :: org.scala-lang#scala-compiler;2.12.1: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn] 
[warn]  Note: Unresolved dependencies path:
[warn]      org.scala-lang:scala-library:2.12.1 ((sbt.Classpaths) Defaults.scala#L1293)
[warn]        +- default:hellotest03_2.12:1.0
[warn]      org.scala-lang:scala-compiler:2.12.1
[warn]        +- default:hellotest03_2.12:1.0
[trace] Stack trace suppressed: run 'last *:update' for the full output.
[trace] Stack trace suppressed: run 'last *:ssExtractDependencies' for the full output.
[error] (*:update) sbt.ResolveException: unresolved dependency: org.scala-lang#scala-library;2.12.1: not found
[error] unresolved dependency: org.scala-lang#scala-compiler;2.12.1: not found
[error] (*:ssExtractDependencies) sbt.ResolveException: unresolved dependency: org.scala-lang#scala-library;2.12.1: not found
[error] unresolved dependency: org.scala-lang#scala-compiler;2.12.1: not found
[error] Total time: 157 s, completed Feb 27, 2017 2:52:34 PM
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=384M; support was removed in 8.0
o0lyfsai

o0lyfsai1#

删除~/.ivy2目录并重新导入。
我更喜欢下载激活器包https://www.lightbend.com/activator/download并使用它来构建我的项目

8ljdwjyq

8ljdwjyq2#

前几天我也遇到过类似的问题。删除我的~/.ivy2目录并重新创建/导入项目已经为我解决了这个问题:)

k4emjkb1

k4emjkb13#

project/build.properties中设置更新的sbt.版本为我修复了这个问题

sbt.version = 1.8.2

相关问题