在sbt项目中运行sbt时出现此错误。我有JDK 8和sbt 0.13.8。我可以毫无问题地运行activator命令,但我需要sbt工作,因为我的IDE(IntelliJ IDEA)使用它来加载项目。
students
答案 0 :(得分:61)
激活器添加到sbt存储库列表的URI缺少第三个斜杠。
打开C:\ Users \ [USER] \ .sbt \ repositories
添加第三个斜杠 (即activator-launcher-local: file:/// $ {activator.local.repository- $ {activator.home- $ {user.home} /.activator} / repository},[组织] / [模块] /(scala_ [scalaVersion] /)(sbt_ [sbtVersion] /)[修改] / [类型] S /工件。[EXT])
答案 1 :(得分:5)
我刚刚删除了C:\ Users [USER]中的.sbt文件夹 并将play项目成功导入intellij。
答案 2 :(得分:4)
解决方案有点棘手(每次都需要重新插入斜杠)。见这里:https://github.com/typesafehub/activator/issues/1037
答案 3 :(得分:1)
This is still an issue with Windows and the fix is to replace file:// with file:/// and doing so is super annoying so a good workaround is to setup a simple ant build.xml in the project root.
<project name="someName" default="run" basedir=".">
<description>
Fix sbt repositories
</description>
<property name="sbtrepo" location="${user.home}/.sbt/repositories"/>
<target name="fixsbt">
<replace file="${sbtrepo}" token="file://$" value="file:///$"/>
</target>
<target name="run" depends="fixsbt">
<exec executable="C:\dev\Git\git-bash.exe" spawn="true">
<arg line="-c 'activator run'" />
</exec>
</target>
</project>
You can either run the fixsbt target alone to do the file replace, or use the run target to fix the repositories file and then run activator. This example uses gitbash shell to run the command so you'll need to change the shell/path for your environment.