我正在尝试在我的gatling项目 build.sbt 中添加一个测试库作为依赖项。我得到 sbt.ResolveException:未解析的依赖 所以只是想知道我如何使用这个自定义库作为依赖。
这是我的build.sbt
enablePlugins(GatlingPlugin)
scalaVersion := "2.12.4"
scalacOptions := Seq(
"-encoding", "UTF-8", "-target:jvm-1.8", "-deprecation",
"-feature", "-unchecked")
libraryDependencies ++= Seq(
"com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.9.4",
"org.scala-lang" % "scala-reflect" % "2.12.4",
"org.scala-lang.modules" %% "scala-xml" % "1.1.0",
"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",
"co.test.utils" % "test-common-utils" % "1.0.9")
"test-common-utils" is the test libary
有人可以帮忙吗?
提前致谢
堆栈跟踪 当我做 sbtcompile 时 这就是我得到的
sbt compile
[info] Loading global plugins from /Users/rv/.sbt/0.13/plugins/project
[info] Loading global plugins from /Users/rv/.sbt/0.13/plugins
[info] Loading project definition from /Users/rv/Documents/workspace/loadtest-gatling/project
[info] Set current project to loadtest-gatling (in build file:/Users /rv/Documents/workspace/loadtest-gatling/)
[info] Updating {file:/Users/rv/Documents/workspace/loadtest-gatling/loadtest-gatling...
[warn] module not found: co.test.common.utils;1.0.9
[warn] ==== local: tried
[warn] /Users/rv/.ivy2/local/co.test.common.utils/1.0.9/ivys/ivy.xml
[warn] ==== local-preloaded-ivy: tried
[warn] file:/Users/rv/.sbt/preloaded/co.test.common.utils1.0.9/ivys/ivy.xml
[warn] ==== local-preloaded: tried
[warn] file:////Users/rv/.sbt/preloaded/co.test.common.utils/1.0.9/common-utils-1.0.9.pom
[warn] ==== public: tried
[info] Resolving jline#jline;2.14.5 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: co.test.common.utils;1.0.9: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Unresolved dependencies path:
[warn] co.test.common.utils:1.0.9 (/Users/rv/Documents/workspace/loadtest-gatling/build.sbt#L16-30)
[warn] +- default:loadtest-gatling_2.12:0.1-SNAPSHOT
sbt.ResolveException: unresolved dependency: co.test.common.utils;1.0.9: not found
at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:243)
at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:158)
at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:156)
at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:147)
at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:147)
at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:124)
at sbt.IvySbt.sbt$IvySbt$$action$1(Ivy.scala:56)
at sbt.IvySbt$$anon$3.call(Ivy.scala:64)
at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:95)
at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:80)
at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:99)
at xsbt.boot.Using$.withResource(Using.scala:10)
at xsbt.boot.Using$.apply(Using.scala:9)
at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:60)
at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:50)
at xsbt.boot.Locks$.apply0(Locks.scala:31)
at xsbt.boot.Locks$.apply(Locks.scala:28)
at sbt.IvySbt.withDefaultLogger(Ivy.scala:64)
at sbt.IvySbt.withIvy(Ivy.scala:119)
at sbt.IvySbt.withIvy(Ivy.scala:116)
at sbt.IvySbt$Module.withModule(Ivy.scala:147)
at sbt.IvyActions$.updateEither(IvyActions.scala:156)
at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1282)
at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1279)
at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$84.apply(Defaults.scala:1309)
at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$84.apply(Defaults.scala:1307)
at sbt.Tracked$$anonfun$lastOutput$1.apply(Tracked.scala:35)
at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1312)
at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1306)
at sbt.Tracked$$anonfun$inputChanged$1.apply(Tracked.scala:45)
at sbt.Classpaths$.cachedUpdate(Defaults.scala:1324)
at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1264)
at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1242)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
at sbt.std.Transform$$anon$4.work(System.scala:63)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.Execute.work(Execute.scala:235)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
[error] (*:update) sbt.ResolveException: unresolved dependency: co.test.common.utils;1.0.9: not found
[error] Total time: 3 s, completed 13-Mar-2018 14:25:47