不是有效的密钥:eclipse(类似:交付,许可,清理)

时间:2015-08-07 23:30:19

标签: playframework typesafe-activator

我已经下载了类型安全激活器并遵循了以下步骤

activator new HelloWorld play-java
cd HelloWorld
activator build
activator eclipse

我收到了错误

[warn] The global sbt directory is now versioned and is located at /Users/abhi/.sbt/0.13.
[warn]   You are seeing this warning because there is global configuration in /Users/abhi/.sbt but not in /Users/abhi/.sbt/0.13.
[warn]   The global sbt directory may be changed via the sbt.global.base system property.
[info] Loading project definition from /Users/abhi/JavaProjects/HelloWorld/project
[warn] The global sbt directory is now versioned and is located at /Users/abhi/.sbt/0.13.
[warn]   You are seeing this warning because there is global configuration in /Users/abhi/.sbt but not in /Users/abhi/.sbt/0.13.
[warn]   The global sbt directory may be changed via the sbt.global.base system property.
[info] Set current project to HelloWorld (in build file:/Users/abhi/JavaProjects/HelloWorld/)
[error] Not a valid command: eclipse (similar: help, alias)
[error] Not a valid project ID: eclipse
[error] Expected ':' (if selecting a configuration)
[error] Not a valid key: eclipse (similar: deliver, licenses, clean)
[error] eclipse
[error]        ^

我用Google搜索了这个问题并找到了

How to use sbt-eclipse to create Eclipse project files of a project?

Installing sbteclipse

我无法弄清楚这些主题中的答案。我确实创建了一个目录

cd ~/.sbt
mkdir plugins
touch plugins.sbt

但我仍然遇到这个错误。有没有人有一个“简洁”的解决方案?

1 个答案:

答案 0 :(得分:11)

在最新的Play版本中,默认情况下不包含sbteclipse插件。这就是激活者不理解“日食”命令的原因。

转到您已创建的项目文件夹,并将以下行追加到project / plugins.sbt:

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")

然后执行以下命令:

activator
compile
eclipse

有关official website

的更多信息