简体   繁体   English

由于缺少常春藤模块,无法创建IntelliJ Scala项目

[英]Cannot Create IntelliJ Scala Project Due to Missing Ivy Module

I am using IntelliJ Community 2019.1. 我正在使用IntelliJ Community 2019.1。 I am trying to create a new Scala project via SBT; 我正在尝试通过SBT创建一个新的Scala项目; however, when the project tries to build and dump project structure from SBT, I get the following error. 但是,当项目尝试从SBT构建和转储项目结构时,我收到以下错误。 SBT version 1.2.7; SBT 1.2.7版; Scala version 2.11.12; Scala版本2.11.12; JDK 1.8.0_202, JDK 1.8.0_202,

Error while importing sbt project:
[error] java.lang.NoClassDefFoundError: org/apache/ivy/core/module/id/ModuleRevisionId
[error]     at sbt.Keys$.<init>(Keys.scala:439)
[error]     at sbt.Keys$.<clinit>(Keys.scala)
[error]     at sbt.Cross$.$anonfun$requireSession$1(Cross.scala:78)
[error]     at sbt.Command$.$anonfun$applyEffect$3(Command.scala:142)
[error]     at sbt.Command$.$anonfun$combine$2(Command.scala:147)
[error]     at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:233)
[error]     at scala.collection.immutable.List.foreach(List.scala:388)
[error]     at scala.collection.TraversableLike.map(TraversableLike.scala:233)
[error]     at scala.collection.TraversableLike.map$(TraversableLike.scala:226)
[error]     at scala.collection.immutable.List.map(List.scala:294)
[error]     at sbt.Command$.$anonfun$combine$1(Command.scala:147)
[error]     at sbt.Command$.process(Command.scala:180)
[error]     at sbt.MainLoop$.processCommand(MainLoop.scala:151)
[error]     at sbt.MainLoop$.$anonfun$next$2(MainLoop.scala:139)
[error]     at sbt.State$$anon$1.runCmd$1(State.scala:246)
[error]     at sbt.State$$anon$1.process(State.scala:250)
[error]     at sbt.MainLoop$.$anonfun$next$1(MainLoop.scala:139)
[error]     at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error]     at sbt.MainLoop$.next(MainLoop.scala:139)
[error]     at sbt.MainLoop$.run(MainLoop.scala:132)
[error]     at sbt.MainLoop$.$anonfun$runWithNewLog$1(MainLoop.scala:110)
[error]     at sbt.io.Using.apply(Using.scala:22)
[error]     at sbt.MainLoop$.runWithNewLog(MainLoop.scala:104)
[error]     at sbt.MainLoop$.runAndClearLast(MainLoop.scala:59)
[error]     at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:44)
[error]     at sbt.MainLoop$.runLogged(MainLoop.scala:35)
[error]     at sbt.StandardMain$.runManaged(Main.scala:138)
[error]     at sbt.xMain.run(Main.scala:89)
[error]     at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
[error]     at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
[error]     at xsbt.boot.Launch$.run(Launch.scala:109)
[error]     at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
[error]     at xsbt.boot.Launch$.launch(Launch.scala:117)
[error]     at xsbt.boot.Launch$.apply(Launch.scala:18)
[error]     at xsbt.boot.Boot$.runImpl(Boot.scala:56)
[error]     at xsbt.boot.Boot$.main(Boot.scala:18)
[error]     at xsbt.boot.Boot.main(Boot.scala)
[error] Caused by: java.lang.ClassNotFoundException: org.apache.ivy.core.module.id.ModuleRevisionId
[error]     at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
[error]     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[error]     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[error]     at sbt.Keys$.<init>(Keys.scala:439)
[error]     at sbt.Keys$.<clinit>(Keys.scala)
[error]     at sbt.Cross$.$anonfun$requireSession$1(Cross.scala:78)
[error]     at sbt.Command$.$anonfun$applyEffect$3(Command.scala:142)
[error]     at sbt.Command$.$anonfun$combine$2(Command.scala:147)
[error]     at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:233)
[error]     at scala.collection.immutable.List.foreach(List.scala:388)
[error]     at scala.collection.TraversableLike.map(TraversableLike.scala:233)
[error]     at scala.collection.TraversableLike.map$(TraversableLike.scala:226)
[error]     at scala.collection.immutable.List.map(List.scala:294)
[error]     at sbt.Command$.$anonfun$combine$1(Command.scala:147)
[error]     at sbt.Command$.process(Command.scala:180)
[error]     at sbt.MainLoop$.processCommand(MainLoop.scala:151)
[error]     at sbt.MainLoop$.$anonfun$next$2(MainLoop.scala:139)
[error]     at sbt.State$$anon$1.runCmd$1(State.scala:246)
[error]     at sbt.State$$anon$1.process(State.scala:250)
[error]     at sbt.MainLoop$.$anonfun$next$1(MainLoop.scala:139)
[error]     at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error]     at sbt.MainLoop$.next(MainLoop.scala:139)
[error]     at sbt.MainLoop$.run(MainLoop.scala:132)
[error]     at sbt.MainLoop$.$anonfun$runWithNewLog$1(MainLoop.scala:110)
[error]     at sbt.io.Using.apply(Using.scala:22)
[error]     at sbt.MainLoop$.runWithNewLog(MainLoop.scala:104)
[error]     at sbt.MainLoop$.runAndClearLast(MainLoop.scala:59)
[error]     at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:44)
[error]     at sbt.MainLoop$.runLogged(MainLoop.scala:35)
[error]     at sbt.StandardMain$.runManaged(Main.scala:138)
[error]     at sbt.xMain.run(Main.scala:89)
[error]     at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
[error]     at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
[error]     at xsbt.boot.Launch$.run(Launch.scala:109)
[error]     at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
[error]     at xsbt.boot.Launch$.launch(Launch.scala:117)
[error]     at xsbt.boot.Launch$.apply(Launch.scala:18)
[error]     at xsbt.boot.Boot$.runImpl(Boot.scala:56)
[error]     at xsbt.boot.Boot$.main(Boot.scala:18)
[error]     at xsbt.boot.Boot.main(Boot.scala)
[error] java.lang.NoClassDefFoundError: org/apache/ivy/core/module/id/ModuleRevisionId

I have tried re-installing IntelliJ, adding the apache ivy jars from Apache (and importing them in the build.sbt!), re-packaging, re-assembling, and restarting the IDE. 我尝试重新安装IntelliJ,从Apache添加apache常春藤罐子(并在build.sbt中导入它们!),重新打包,重新组装和重新启动IDE。 None of which have worked to create a new project. 其中没有一个能够创建一个新项目。

Any assistance in resolving the error is greatly appreciated. 非常感谢任何解决错误的帮助。 Thank you! 谢谢!

After a considerable amount of trial and error, Google searches, and frustration, I finally found and corrected the issue I was having! 经过大量的反复试验,谷歌搜索和挫折,我终于找到并纠正了我遇到的问题!

There was an sbt version conflict; 有一个sbt版本冲突; I was attempting to use sbt 1.2.7, but when I upgraded to sbt 1.2.8, all has been working as expected. 我试图使用sbt 1.2.7,但是当我升级到sbt 1.2.8时,所有都按预期工作。 I am able to create new projects via sbt, and build existing projects I've cloned from my company's enterprise GitHub. 我能够通过sbt创建新项目,并构建我从公司的企业GitHub克隆的现有项目。 I hope this can help someone else save hours of work and frustration! 我希望这可以帮助别人节省数小时的工作和挫折!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 IntelliJ中的SBT Project和Scala模块有什么区别? - What are the differences in SBT Project and Scala Module in IntelliJ? 如何设置一个IntelliJ Idea Scala项目以识别本地Ivy2缓存? - How to set up an IntelliJ Idea Scala project to recognize local Ivy2 cache? IntelliJ 14 - 创建/导入 Scala/SBT 项目 - IntelliJ 14 - Create / Import a Scala / SBT project 如何在IntelliJ和Scala中创建Maven项目以获得火花 - How to create Maven Project in intellij and scala for spark IntelliJ Idea Maven项目中Scala模块的Scala签名错误 - Scala signature error for Scala module in IntelliJ Idea Maven project 没有IntelliJ中的错误,无法为Scala创建SparkSession - Cannot Create SparkSession for Scala Without an Error in IntelliJ 与Intellij 2018.3.3不兼容的Scala插件:无法在“ New Project”中选择Scala - Scala plugin incompatible with Intellij 2018.3.3: Cannot select Scala in “New Project” IntelliJ:多模块scala(SBT)项目源代码重构 - IntelliJ: multi-module scala (SBT) project source code refactoring Intellij不适用于多模块Maven Scala项目 - Intellij doesn't work well with multi module maven scala project intellij-我创建哪个Scala项目,Scala-Scala或Scala-SBT? - intellij - Which Scala project do I create, Scala-Scala or Scala-SBT?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM