softprops/heroic — Issue #2: Heroic source jar not recognized as matching classes
Author: mslinn
Created: 2012-01-10 15:22:35+00:00
State: open

I created an Eclipse project from the heroic GitHub project using sbteclipse 11.2, using Windows XP SP3.

~/.sbt/plugins/build.sbt:
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse" % "latest.milestone")

Project available from:
https://github.com/softprops/heroic

Generated Eclipse project with:
sbt "eclipse with-source=true"

In herioc.scala, pressing F3 on the import sbt.Project does not display the source, instead the message "Current text selection cannot be opened in an editor" appears. I could see the class file in the Eclipse editor, so I clicked on the "Change attached source" button and manually selected the matching source jar. This message appeared: "The source attachment does not contain the source for the file Project.class". I opened the source jar, and found that the class was in fact defined there.

Somehow Eclipse cannot recognize that the source matches the binary jar. Perhaps this is a bug in how Heroic is packaged. Somehow the wrong source jar has been associated with the binary jar.

I originally posted to [Scala IDE](http://www.assembla.com/spaces/scala-ide/support/tickets/1000844-sbt-source-jar-not-recognized-as-matching-classes#last_comment) and they suggested that this issue might be best followed up here.