本文介绍了Intellij和sbt 0.13.5“URI具有权限组件”。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Java和Amazon Web Services开发一个play框架项目。这是我的build.sbt:

I'm working on a play framework project using Java as well as Amazon Web Services. This is my build.sbt:

name := """RegistrationEndpoint"""

version := "1.0"

lazy val root = (project in file(".")).enablePlugins(PlayJava)

scalaVersion := "2.11.5"

libraryDependencies ++= Seq(
javaJdbc,
cache,
javaWs
)

// Play provides two styles of routers, one expects its actions to be injected, the
// other, legacy style, accesses its actions statically.
//routesGenerator := InjectedRoutesGenerator

如果我调用activator run,它会与激活器一起运行在命令行上。

It runs with activator if I call "activator run" on the command line.

Intellij无法构建项目。它返回以下错误消息

Intellij cannot build the project. It returns the following error message

java.lang.IllegalArgumentException: URI has an authority component
    at java.io.File.<init>(File.java:423)
    at sbt.Classpaths$.sbt$Classpaths$$bootRepository(Defaults.scala:1758)
    at sbt.Classpaths$$anonfun$appRepositories$1.apply(Defaults.scala:1729)
    at sbt.Classpaths$$anonfun$appRepositories$1.apply(Defaults.scala:1729)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
    at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
    at scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:34)
    at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
    at scala.collection.AbstractTraversable.map(Traversable.scala:105)
    at sbt.Classpaths$.appRepositories(Defaults.scala:1729)
    at sbt.Classpaths$$anonfun$41.apply(Defaults.scala:1102)
    at sbt.Classpaths$$anonfun$41.apply(Defaults.scala:1102)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
    at sbt.EvaluateSettings$MixedNode.evaluate0(INode.scala:175)
    at sbt.EvaluateSettings$INode.evaluate(INode.scala:135)
    at sbt.EvaluateSettings$$anonfun$sbt$EvaluateSettings$$submitEvaluate$1.apply$mcV$sp(INode.scala:69)
    at sbt.EvaluateSettings.sbt$EvaluateSettings$$run0(INode.scala:78)
    at sbt.EvaluateSettings$$anon$3.run(INode.scala:74)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
[error] java.lang.IllegalArgumentException: URI has an authority component

当我从任何地方调用sbt时会产生同样的错误(通过在命令行上调用sbt)

This same error results when I call sbt from anywhere (By calling "sbt" on the command line)

对于我应该看的地方有什么建议吗?错误消息不包括我的实际playframework项目中的任何位置。

Any suggestions for where I should look? The error message does not include any locations in my actual playframework project.

推荐答案

Activator以某种方式在C中为Windows创建格式错误的存储库URI: / Users / User_Name / .sbt / repositories

Activator somehow creates malformed repository URIs for Windows in C:/Users/User_Name/.sbt/repositories

将激活器回购更改为以下值(请注意文件后的三个斜杠:)已修复我的问题。

Changing the activator repos to the below values (please note the three slashes after file:) fixed the issue for me.

[repositories]
  local
  activator-launcher-local: file:///${activator.local.repository-${activator.home-${user.home}/.activator}/repository}, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
  activator-local: file:///${activator.local.repository-//D:/Qudosoft/activator-1.3.4/repository}, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
  maven-central
  ...

然而每一个你开始交流的时间tivator UI或稍后通过激活器创建一个新项目的文件将再次更改。所以这只是一个临时解决方法,直到它在激活器中修复。

However every time you start activator UI or create a new project via activator later on the file is changed back again. So this is just a temporary workaround until it is fixed in activator.

您可以订阅,以便在修复错误时收到通知。

You can subscribe to https://github.com/typesafehub/activator/issues/1033 to be notified when the bug is fixed.

这篇关于Intellij和sbt 0.13.5“URI具有权限组件”。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-20 13:55