Skip to content
This repository

Plugin for sbt to create Eclipse project definitions

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 example
Octocat-spinner-32 src
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.textile
Octocat-spinner-32 build.sbt
README.textile

sbteclipse

This project is a plugin for sbt 0.11.x providing a command to create Eclipse project files from a sbt project (possibly containing subprojects).

Latest changes

  • #37: Use workspace default JRE
  • #31: Reference to scalaVersion is ambiguous
  • #28: Add skip-parents option
  • #27: Add info message “This might take some time …” when command starts
  • #24: Switch to sbt 0.11

Installing sbteclipse as a sbt plugin

  • To “install” the plugin, either use a local or the global plugin definition (for details about sbt plugins please see the sbt documentation):
    • The local plugin is just a build.sbt file in the project/plugins folder of your project
    • The global plugin is defined via a build.sbt file in the directory ~/.sbt/plugins.
  • Just add the below lines to your build.sbt file, paying attention to the blank lines:

resolvers += Classpaths.typesafeResolver

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse" % "1.4.0")

Using sbteclipse to create Eclipse project files

  • As soon as sbteclipse is properly set up as a plugin, you can use the command eclipse in an sbt session to create Eclipse project files
  • There is autocompletion available, just use the tab key
  • After having created the Eclipse project files you can import the project in Eclipse using the “Import Wizard” to import “Existing Projects into Workspace”

Options

  • create-src to create the common source directories, e.g. src/main/scala, src/main/test, etc.
  • same-targets to make sbt and Eclipse compile into the same target directories; by default the Eclipse directories will be different, e.g. .target
  • skip-parents to skip project creation for all parent projects (projects aggregating sub projects)
  • skip-root to skip project creation for the root project
  • with-sources to create source attachments for the library dependencies

Example

tmp$ mkdir test
tmp$ cd test
test$ sbt
> eclipse create-src
[info] Successfully created Eclipse project files. Please select the appropriate Eclipse plugin for Scala 2.9.1!

License

sbteclipse is open source software licensed under the Apache 2.0 License. If you like it, feel free to use it!

Contribution policy

Contributions via GitHub pull requests are gladly accepted from their original author. Along with any pull requests, please state that the contribution is your original work and that you license the work to the sbteclipse project under the project’s open source license.

Something went wrong with that request. Please try again.