Adding and removing dependencies with SBT and Scala IDE
Asked Answered
T

2

10

I've been experimenting with SBT and the Scala IDE (Eclipse) and I'm wondering - what's the standard workflow for adding and removing dependencies from your build.sbt file where the project's referenced libraries will be updated in Eclipse?

Are there any current plugins that are required to use sbt with eclipse when adding / removing dependencies?

Tonus answered 11/9, 2011 at 19:50 Comment(5)
Hmm isn't it just adding/removing the dependency declaration in the project/build file?Twinflower
Modify SBT build file and then re-run SBT-eclipse plugin if necessary?Atbara
@Kipton I've tried that, but re-running sbteclipse and refreshing my project in Eclipse doesn't pick up any changes. Is is supposed to?Tonus
@Enrico Just adding/removing dependency declarations from my build.sbt doesn't effect the project in Eclipse.Tonus
@Josh, I would imagine it's supposed to pick up the changes. If you don't get a response here, maybe check the known issues for sbteclipse on github, and then ask on the Scala IDE mailing list?Atbara
V
11

The sbteclipse plugin will do it. The key is that whenever you change your dependencies you need to re-run the command to create the Eclipse files. I use:

eclipse same-targets

Then you need to right-click on the project in Eclipse and choose Refresh.

Viral answered 22/9, 2011 at 20:38 Comment(1)
I'm pretty new to Eclipse (and Scala), but when I attempted to run this eclipse target I was unpleasantly surprised to find it had totally regenerated my .project and .classpath files. I executed 'sbt eclipse' from the command line because 'sbt eclipse same-targets' failed (same-targets was not found).Outflank
A
2

I also needed this. I can confirm that re-running the eclipse task from the sbteclipse plugin (version 1.3-RC3 for SBT 0.10.1) will indeed regenerate the Eclipse project files (these are .project and .classpath). If you're seeing something else, it sounds like a bug that should be reported.

Atbara answered 18/9, 2011 at 4:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.