尝试解决SBT中的依赖关系时出现IIllegalArgumentException

时间:2015-09-03 16:38:52

标签: scala intellij-idea

我在Intellij有一个Scala项目(SBT)。我想包含以下依赖项:

libraryDependencies += "org.eclipse.jetty" % "jetty-server" % "9.3.3.v20150827"

libraryDependencies += "org.eclipse.jetty" % "jetty-servlet" % "9.3.3.v20150827"

libraryDependencies += "org.eclipse.jetty" % "jetty-webapp" % "9.3.3.v20150827"

不幸的是,我收到了错误:

  

未解决的依赖项:org.eclipse.jetty#jetty-webapp; 9.3.3.v20150827:   解决依赖时出现了几个问题:   org.eclipse.jetty#码头-web应用; 9.3.3.v20150827   {compile = [default(compile)]}:[error]发生了几个问题   解决依赖:org.eclipse.jetty#jetty-project; 9.3.3.v20150827   {}:[error]解决依赖时出现了几个问题:   org.eclipse.jetty#jetty-parent; 25 {}:[error]     java.lang.IllegalArgumentException:protocol = http host = null   [error] java.lang.IllegalArgumentException:protocol = http host =   null [error] java.lang.IllegalArgumentException:protocol = http host   = null [error] [error] java.lang.IllegalArgumentException:protocol = http host = null [error] java.lang.IllegalArgumentException:protocol = http host = null [error] [error]     java.lang.IllegalArgumentException:protocol = http host = null   [error] java.lang.IllegalArgumentException:protocol = http host =   null [error]使用'last'作为完整日志。

我该如何解决?

1 个答案:

答案 0 :(得分:0)

必须是某些网络/存储库设置问题。适合我:

build.sbt

libraryDependencies += "org.eclipse.jetty" % "jetty-server" % "9.3.3.v20150827"

libraryDependencies += "org.eclipse.jetty" % "jetty-servlet" % "9.3.3.v20150827"

libraryDependencies += "org.eclipse.jetty" % "jetty-webapp" % "9.3.3.v20150827"

SBT:

[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] downloading https://jcenter.bintray.com/org/eclipse/jetty/jetty-server/9.3.3.v20150827/jetty-server-9.3.3.v20150827.jar ...
[info]  [SUCCESSFUL ] org.eclipse.jetty#jetty-server;9.3.3.v20150827!jetty-server.jar (5608ms)
[info] downloading https://jcenter.bintray.com/org/eclipse/jetty/jetty-servlet/9.3.3.v20150827/jetty-servlet-9.3.3.v20150827.jar ...
[info]  [SUCCESSFUL ] org.eclipse.jetty#jetty-servlet;9.3.3.v20150827!jetty-servlet.jar (3476ms)
[info] downloading https://jcenter.bintray.com/org/eclipse/jetty/jetty-webapp/9.3.3.v20150827/jetty-webapp-9.3.3.v20150827.jar ...
[info]  [SUCCESSFUL ] org.eclipse.jetty#jetty-webapp;9.3.3.v20150827!jetty-webapp.jar (2489ms)
[info] downloading https://jcenter.bintray.com/org/eclipse/jetty/jetty-http/9.3.3.v20150827/jetty-http-9.3.3.v20150827.jar ...
[info]  [SUCCESSFUL ] org.eclipse.jetty#jetty-http;9.3.3.v20150827!jetty-http.jar (2783ms)
[info] downloading https://jcenter.bintray.com/org/eclipse/jetty/jetty-io/9.3.3.v20150827/jetty-io-9.3.3.v20150827.jar ...
[info]  [SUCCESSFUL ] org.eclipse.jetty#jetty-io;9.3.3.v20150827!jetty-io.jar (3279ms)
[info] downloading https://jcenter.bintray.com/org/eclipse/jetty/jetty-util/9.3.3.v20150827/jetty-util-9.3.3.v20150827.jar ...
[info]  [SUCCESSFUL ] org.eclipse.jetty#jetty-util;9.3.3.v20150827!jetty-util.jar (7722ms)
[info] downloading https://jcenter.bintray.com/org/eclipse/jetty/jetty-security/9.3.3.v20150827/jetty-security-9.3.3.v20150827.jar ...
[info]  [SUCCESSFUL ] org.eclipse.jetty#jetty-security;9.3.3.v20150827!jetty-security.jar (2490ms)
[info] downloading https://jcenter.bintray.com/org/eclipse/jetty/jetty-xml/9.3.3.v20150827/jetty-xml-9.3.3.v20150827.jar ...
[info]  [SUCCESSFUL ] org.eclipse.jetty#jetty-xml;9.3.3.v20150827!jetty-xml.jar (1945ms)
[info] Done updating.
[success] Total time: 53 s, completed 3 Sep, 2015 11:17:11 PM
> sbtBinaryVersion
[info] 0.13
> console
[info] Starting scala interpreter...
[info] 
Welcome to Scala version 2.10.5 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_80).
Type in expressions to have them evaluated.
Type :help for more information.
scala> util.Properties.version
versionMsg            versionNumberString   versionString         

scala> util.Properties.versionString
res3: String = version 2.10.5

检查您的Java / Scala和存储库设置。

还可以尝试将此解析程序添加到build.sbt~/.sbt/0.13/plugins/plugins.sbt

resolvers += "Sonatype snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/"