sbt-eclipse icon indicating copy to clipboard operation
sbt-eclipse copied to clipboard

sbteclipse does not respect dependencies order

Open Phil4 opened this issue 13 years ago • 1 comments

I have started a new sbt project using Java EE 6 API with Glassfish Embedded for testing purpose. This is represented by the following dependencies:

"org.glassfish.main.extras" % "glassfish-embedded-all" % "3.1.2.2" % "test",
"javax" % "javaee-api" % "6.0" % "provided"

The order of these dependencies is important for Eclipse since both will be referenced in Eclipse project. Indeed, using sbteclipse, javaee-api appears in first place and will then be used, leading to the error:

"java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file"

This is because javaee-api only contains an API without the implementation (which is in glassfish-embedded-all).

javaee-api should therefore not be used at all for tests but it is still necessary for sbt to compile the project correctly.

I then thought that it would be great if sbteclipse could respect the dependencies order as it is the case in Maven currently.

Phil4 avatar Dec 24 '12 13:12 Phil4

Huh, I'll see what I can do here. I think most of the Ivy code makes no assumption on ordering, as it's kind of dangerous. We may be able to make a magical configuration that is ignored for runtime/eclipse though....

Let me think on this.

jsuereth avatar Apr 15 '13 19:04 jsuereth