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

Support duplicate dependencies just differing on Configuration

Open jonfreedman opened this issue 14 years ago • 2 comments

I want to have a compile dependency on the core spring jars and a test dependency on the testing jars, I can set this up and compile in SBT fine using:

"[our internal classification]" % "spring" % "3.0.5" % "compile->runtime", "[our internal classification]" % "spring" % "3.0.5" % "it,test->testing"

But the testing jar's are not included in the IntelliJ project. If I want to be able to compile in both SBT & IntelliJ I have to use

"[our internal classification]" % "spring" % "3.0.5" % "compile->runtime,testing"

Prior to upgrading to sbt 0.11.0 this used to work

jonfreedman avatar Nov 03 '11 14:11 jonfreedman

You could test if the latest snapshot which includes a fix for #145 improves the situation with the case described in this issue.

This looks like a similar issue, but I don't know exactly how to test this. Could I just use for example the spring -jars from public repository with the configuration you describe above?

mpeltonen avatar Apr 17 '12 07:04 mpeltonen

Not sure if this is the right place to post this, or #233. The latter broke gen-idea for me when upgrading to the latest version. See b6c33ec2a6c66a4065871e4e904bce1477320f02 for the failing test case. Commit comment has our scenario, but for reference, the pain is:

In our case, we use logback-common in the runtime scope (production code is compiled against com.typesafe/scalalogging-slf4j_2.10 scalalogging-slf4j_2.10-1.0.1.jar). We also use logback-common in the test scope. We depend on the implementation for testing logging.

mpeltonen/sbt-idea#233 changed the ordering so that the jar is only in the Runtime scope in IntelliJ. This prevents IntelliJ from compiling the tests.

gshakhn avatar Nov 21 '13 23:11 gshakhn