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

Fix classpath order

Open bchallenor opened this issue 11 years ago • 0 comments

The Typesafe config library (as used by Akka) loads reference.conf for every library and applies overrides according to the classpath order.

sbt-idea currently generates the classpath in the wrong order, so while my code works with sbt run, it does not work in Idea.

I have multiple projects:

lazy val common = Project(id = "common", base = file("common"))
lazy val enc = Project(id = "enc", base = file("enc")) dependsOn(common)

but sbt-idea is putting common at the end of the classpath, after akka-actor, and so its reference.conf does not take effect. Manually moving common up the classpath (Project Structure > Modules > enc > Dependencies > common) fixes this.

I believe that the classpath should be ordered by a topological sort obeying sbt dependencies: if lib/project A depends on lib/project B, then A must come before B so that it can override reference.conf.

bchallenor avatar Jun 16 '13 13:06 bchallenor