gpt4 book ai didi

scala - SBT/ScalaTest : Configurations already specified for module

转载 作者:行者123 更新时间:2023-12-02 09:30:45 32 4
gpt4 key购买 nike

克隆 SBT 存储库并尝试在目录中启动 SBT shell 后,出现以下错误

java.lang.IllegalArgumentException: requirement failed: Configurations already specified for module com.holdenkarau:spark-testing-base:2.2.0_0.7.2:test

完整的堆栈跟踪如下所示

[error] java.lang.IllegalArgumentException: requirement failed: Configurations already specified for module com.holdenkarau:spark-testing-base:2.2.0_0.7.2:test
[error] at scala.Predef$.require(Predef.scala:277)
[error] at sbt.librarymanagement.DependencyBuilders.moduleIDConfigurable(DependencyBuilders.scala:30)
[error] at sbt.librarymanagement.DependencyBuilders.moduleIDConfigurable$(DependencyBuilders.scala:29)
[error] at sbt.package$.moduleIDConfigurable(package.scala:6)
[error] at $080896ebbef320cbbd4a$.$anonfun$$sbtdef$2(/Users/username/company/repo/submodule/build.sbt:37)
[error] at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:234)
[error] at scala.collection.immutable.List.foreach(List.scala:389)
[error] at scala.collection.TraversableLike.map(TraversableLike.scala:234)
[error] at scala.collection.TraversableLike.map$(TraversableLike.scala:227)
[error] at scala.collection.immutable.List.map(List.scala:295)
[error] at $080896ebbef320cbbd4a$.$anonfun$$sbtdef$1(/Users/username/company/repo/submodule/build.sbt:37)
[error] at sbt.internal.util.EvaluateSettings.$anonfun$constant$1(INode.scala:197)
[error] at sbt.internal.util.EvaluateSettings$MixedNode.evaluate0(INode.scala:214)
[error] at sbt.internal.util.EvaluateSettings$INode.evaluate(INode.scala:159)
[error] at sbt.internal.util.EvaluateSettings.$anonfun$submitEvaluate$1(INode.scala:82)
[error] at sbt.internal.util.EvaluateSettings.sbt$internal$util$EvaluateSettings$$run0(INode.scala:93)
[error] at sbt.internal.util.EvaluateSettings$$anon$3.run(INode.scala:89)
[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] java.lang.IllegalArgumentException: requirement failed: Configurations already specified for module com.holdenkarau:spark-testing-base:2.2.0_0.7.2:test
[error] Use 'last' for the full log.
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?

此错误的原因是什么以及如何解决?

<小时/>

我的项目配置是

  • Scala v2.11.11
  • SBT v1.0.3
<小时/>

更新1

这是我的 build.sbt 文件

import AwsDependencies._
import Dependencies._
import SparkDependencies._

version := "0.0.1"

// core settings
organization := "com.company"
scalaVersion := "2.11.11"

// cache options
offline := false
updateOptions := updateOptions.value.withCachedResolution(true)

// aggregate options
aggregate in assembly := false
aggregate in update := false

// fork options
fork in Test := true

name := "Submodule"
version := "0.0.1"

//common libraryDependencies
libraryDependencies ++= Seq(
scalaTest,
typesafeConfig,
jodaTime,
mysql,
json,
scopt,
awsS3,
sparkTesting
)

libraryDependencies ++= SparkDependencies.allSparkDependencies.map(_ % "provided")

assemblyMergeStrategy in assembly := {
case m if m.toLowerCase.endsWith("manifest.mf") => MergeStrategy.discard
case m if m.startsWith("META-INF") => MergeStrategy.discard
case PathList("javax", "servlet", _@_*) => MergeStrategy.first
case PathList("org", "apache", _@_*) => MergeStrategy.first
case PathList("org", "jboss", _@_*) => MergeStrategy.first
case "about.html" => MergeStrategy.rename
case "reference.conf" => MergeStrategy.concat
case "application.conf" => MergeStrategy.concat
case _ => MergeStrategy.first
}

堆栈跟踪报告此build.sbt(相关子模块)的以下行上的错误

libraryDependencies ++= SparkDependencies.allSparkDependencies.map(_ % "provided")

最佳答案

我知道我这个答案可能有点晚了,但 SparkDependency.allSparkDependency 中的条目之一似乎已经包含 %provided,所以 SparkDependency.allSparkDependency.map( _ % "provided") 正在尝试再次添加它,这会导致问题。尝试简单地从 SparkDependency.allSparkDependency 中删除 %provided

关于scala - SBT/ScalaTest : Configurations already specified for module,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47925834/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com