当有一个包含以下内容的脚本文件 (file.sc) 时:
import ammonite._, Resolvers._
val mock_client_repo = Resolver.Http("Unisay at bintray","http://dl.bintray.com/unisay/maven",MavenPattern,true)
interp.resolvers() = interp.resolvers() :+ mock_client_repo
import $ivy.`com.github.unisay::mockserver-client-scala:0.2.0`
import org.mockserver.client.server.MockServerClient
import com.github.unisay.mockserver.scala.DSL.Statuses._
import com.github.unisay.mockserver.scala.DSL._
val port = 3000
val host = "127.0.0.1"
implicit val server = new MockServerClient(host,port)
forAnyRequest respond Ok
我试图执行如下:amm files.sc
我收到以下错误:
编译 file.sc :: 加载设置 :: url = jar:file:/usr/local/bin/amm!/org/apache/ivy/core/settings/ivysettings.xml :: 解决依赖关系 :: com.github.unisay #mockserver-client-scala_2.11-caller;工作配置:[默认]
:: 问题总结 :: :::: WARNINGS module not found: com.github.unisay#mockserver-client-scala_2.11;0.2.0
==== 本地:试过
/home/eli/.ivy2/local/com.github.unisay/mockserver-client-scala_2.11/0.2.0/ivys/ivy.xml
-- artifact
com.github.unisay#mockserver-client-scala_2.11;0.2.0!mockserver-client-scala_2.11.jar:
/home/eli/.ivy2/local/com.github.unisay/mockserver-client-scala_2.11/0.2.0/jars/mockserver-client-scala_2.11.jar
==== m2: 试过
/home/eli/.m2/repository/com/github/unisay/mockserver-client-scala_2.11/0.2.0/ivy-0.2.0.xml
-- artifact
com.github.unisay#mockserver-client-scala_2.11;0.2.0!mockserver-client-scala_2.11.jar:
/home/eli/.m2/repository/com/github/unisay/mockserver-client-scala_2.11/0.2.0/mockserver-client-scala_2.11-0.2.0.jar
==== 中央:试过
-- artifact
com.github.unisay#mockserver-client-scala_2.11;0.2.0!mockserver-client-scala_2.11.jar:
:: 使用详细或调试消息级别获取更多详细信息线程“主”ammonite.runtime.tools.IvyThing$IvyResolutionException 中的异常:无法解决常春藤依赖项未解决的依赖项:com.github.unisay#mockserver-client-scala_2.11;0.2 .0:未找到
但是,如果运行从 repl 中粘贴的相同代码副本,则一切正常。
我究竟做错了什么?