org.scala-xml _2.12.4;未找到1.0.6

时间:2018-03-07 12:26:51

标签: scala sbt gatling

我得到了" 未解决的依赖关系"警告和" org.scala-lang.modules#scala-xml _2.12.4; 1.0.6:"我在尝试编译sbt项目时找不到。有谁知道这个错误的原因?

build.sbt

enablePlugins(GatlingPlugin)

scalaVersion := "2.12.4"

ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) }

scalacOptions := Seq(
 "-encoding", "UTF-8", "-target:jvm-1.8", "-deprecation",
 "-feature", "-unchecked", "-language:implicitConversions")

javaOptions in Gatling := overrideDefaultJavaOptions(
"-Xms1G",
"-Xmx2G",
"-Djsse.enableSNIExtension=false")

libraryDependencies ++= Seq(
 "com.fasterxml.jackson.module" % "jackson-module-scala_2.11" % "2.8.2",
 "org.scala-lang" % "scala-reflect" % "scalaVersion.value",
 "org.scala-lang.modules" % "scala-xml _2.12.4" % "1.0.6",

"com.amazonaws" % "aws-java-sdk-sqs" % "1.10.19",
"com.amazonaws" % "aws-java-sdk-sts" % "1.10.19",
"com.amazonaws" % "aws-java-sdk-s3" % "1.10.19",
"com.amazonaws" % "aws-java-sdk-dynamodb" % "1.10.19",

"org.bouncycastle" % "bcpg-jdk15on" % "1.52",
"org.bouncycastle" % "bcprov-jdk15on" % "1.52",

"io.gatling.highcharts" % "gatling-charts-highcharts" % "2.3.0" % "test",
"io.gatling" % "gatling-test-framework" % "2.3.0" % "test",
"com.typesafe" % "config" % "1.3.2")

这是错误

Error:Error while importing SBT project:
...
[info] Resolving org.bouncycastle#bcprov-jdk15on;1.58 ...
[info] Resolving io.gatling#gatling-test-framework;2.3.0 ...
[info] Resolving org.scala-sbt#test-interface;1.0 ...
[info] Resolving org.scala-lang#scala-compiler;2.12.4 ...   
[info] Resolving jline#jline;2.14.5 ...
[warn]     ::::::::::::::::::::::::::::::::::::::::::::::
[warn]     ::          UNRESOLVED DEPENDENCIES         ::
[warn]     ::::::::::::::::::::::::::::::::::::::::::::::
[warn]     :: org.scala-lang.modules#scala-xml _2.12.4;1.0.6: not found
[warn]     ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  
[warn]     Note: Unresolved dependencies path: 
[warn]         org.scala-lang.modules:scala-xml _2.12.4:1.0. 
[warn]           +- default:loadtest-gatling_2.12:0.1-SNAPSHOT
[trace] Stack trace suppressed: run 'last *:update' for the full output.
[error] (*:ssExtractDependencies) sbt.ResolveException: unresolved dependency:
    org.scala-lang.modules#scala-xml _2.12.4;1.0.6: not found
[error] (*:update) sbt.ResolveException: unresolved dependency: org.scala-
lang.modules#scala-xml _2.12.4;1.0.6: not found
[error] Total time: 3 s, completed 07-Mar-2018 12:04:37

plugins.sbt

 resolvers += Resolver.url("gatling", url("https://dl.bintray.com/content
/gatling/sbt-plugins/"))(Resolver.ivyStylePatterns)
addSbtPlugin("io.gatling" % "gatling-sbt" % "2.2.2")

build.properties     sbt.version = 0.13.1

提前致谢

1 个答案:

答案 0 :(得分:1)

你用这个:

"org.scala-lang.modules" % "scala-xml_2.12" % "1.0.6",

这样做是必要的,因为你不需要指定精确的scala版本,只需2.12即可。

或者使用此

"org.scala-lang.modules" %% "scala-xml" % "1.0.6"

%%将帮助您下载特定于scala版本的依赖项。