Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not a valid key: eclipse (similar: deliver, licenses, clean)

I have downloaded typesafe activator and have followed following steps

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

I got an error

[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]        ^

I googled for this problem and found

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

Installing sbteclipse

I can't figure out the answers in these threads. I did create a directory

cd ~/.sbt
mkdir plugins
touch plugins.sbt

But I still get this error. Does anyone have a "concise" solution which works?

like image 389
Knows Not Much Avatar asked Dec 20 '22 01:12

Knows Not Much


1 Answers

In the latest Play release, the sbteclipse plugin is not included by default. Thats's why activator doesn't understand the "eclipse" command.

Go to the project folder that you've already created and append the following line to project/plugins.sbt:

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

Then execute the following commands:

activator
compile
eclipse

More info on the official website

like image 102
franz.fonta Avatar answered Jan 15 '23 05:01

franz.fonta