Skip to content

Instantly share code, notes, and snippets.

@rossabaker
Created June 17, 2010 04:20
Show Gist options
  • Save rossabaker/441675 to your computer and use it in GitHub Desktop.
Save rossabaker/441675 to your computer and use it in GitHub Desktop.
sbt scopes more like Maven
override def ivyXML =
<configurations defaultconfmapping="*->default(compile)">
<conf name="compile" />
<conf name="runtime" extends="compile" />
<conf name="test" extends="runtime" />
<conf name="provided" />
</configurations>
override def defaultConfigurationExtensions = false
@rossabaker
Copy link
Author

sbt doesn't resolve library conflicts across Ivy configurations. If a compile-scoped jar depends on log4j-1.2.12, and a runtime-scoped jar depends on log4j-1.2.14, both end up on sbt's runtime classpath and in the jar. The above lets Ivy resolve the conflicts in a more Maven-like fashion, at the expense of a bloated lib_managed (each jar is copied into each child configuration).

Is there a better way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment