After I want to use activator eclipse commond, I should see the project with all jars in SBT Dependency Library container with eclipse project,Just like Maven Dependencies container.How to do it? or do not sbteclipse plugin have the function?
Asked
Active
Viewed 554 times
1 Answers
1
This works for me:
Make sure you have sbteclipse configured as described here.
You could add this to your sbt configuration at
~/.sbt/0.13/plugins/plugins.sbt
:addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "3.0.0")
Create a scala app with activator
activator new minimal-scala minimal-scala ... OK, application "hello-world" is being created using the "minimal-scala" template. ...
Compile and run the application
cd hello-world activator run ... [info] Running com.example.Hello Hello, world! [success] Total time: 0 s, completed Jun 11, 2015 8:50:20 PM
Create the eclipse project with activator
activator eclipse [info] Set current project to hello-world (in build file:/Users/...) [info] About to create Eclipse project files for your project(s). [info] Successfully created Eclipse project files for project(s): [info] hello-world
This will create the
.project
and.classpath
files that eclipse needs.Now import the project in Eclipse
- Select from the menu:
File > Import...
- Type
ex
in the text field that filters project types and selectExisting Projects into Workspace
- Select your project folder with
Browse...
button and click Finish
Now you should see your project in eclipse with all dependencies that are in your sbt build specification (e.g.
build.sbt
). The sbt dependencies come up inReferenced Libraries
.- Select from the menu:
When you want to change your dependencies, you
- edit your
build.sbt
- run
activator eclipse
again - select the project in Eclipse and refresh (e.g. hit F5 key or right click and
refresh
)
- edit your

fredfred
- 196
- 2
- 5
-
sorry,That is not my question which you understand.I must add the sbteclipse plugin , after we run the 'eclipse' commond with activator,we can import the project into eclipse,but in the eclipse project explorer,we can see all dependency jar display in the root directory.I want to take all jar into a container,when I run the eclipse commond. – Hao Li Jun 12 '15 at 01:48