Why doesn't sbt warn about these conflicting versions?

153 views
Skip to first unread message

Paul Butcher

unread,
Jan 14, 2013, 5:40:42 AM1/14/13
to simple-b...@googlegroups.com
I recently had a ScalaMock user report a bug that turned out to be a result of conflicting ScalaTest versions. What I'm confused about is that sbt didn't give any kind of warning. I suspect that I've got something wrong in my dependencies, but I'm not sure what it might be.

Here's the POM for ScalaMock:


The relevant section is:

<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.10.0</artifactId>
<version>2.0.M5</version>
</dependency>

This is the build.sbt that causes the problem:


And here's the relevant section:

libraryDependencies ++= Seq(
  "org.scalatest" % "scalatest_2.10" % "1.9.1" % "test",
  "org.scalamock" %% "scalamock-scalatest-support" % "3.0" % "test"
)

Running this project gives the following output:

pauls-macbook:scalaMockExample paul$ sbt
Detected sbt version 0.12.2-RC1
Starting sbt: invoke with -help for other options
Using /Users/paul/.sbt/0.12.2-RC1 as sbt dir, -sbt-dir to override.
[info] Set current project to scannerTest (in build file:/Users/paul/personal/jangoolie/scalaMockExample/)
[info] Defining */*:log-level
[info] The new value will be used by no settings or tasks.
[info] Reapplying settings...
[info] Set current project to scannerTest (in build file:/Users/paul/personal/jangoolie/scalaMockExample/)
[info] Defining */*:console-project::trace-level, */*:console::trace-level and 2 others.
[info] The new values will be used by no settings or tasks.
[info] Run `last` for details.
[info] Reapplying settings...
[info] Set current project to scannerTest (in build file:/Users/paul/personal/jangoolie/scalaMockExample/)
> test
[info] Updating {file:/Users/paul/personal/jangoolie/scalaMockExample/}default-c3d626...
[info] Resolving org.sonatype.oss#oss-parent;7 ...
[info] [SUCCESSFUL ] org.scalatest#scalatest_2.10;1.9.1!scalatest_2.10.jar (18809ms)
[info] [SUCCESSFUL ] org.scalamock#scalamock-scalatest-support_2.10;3.0!scalamock-scalatest-support_2.10.jar (2684ms)
[info] [SUCCESSFUL ] org.scala-lang#scala-actors;2.10.0!scala-actors.jar (3299ms)
[info] [SUCCESSFUL ] org.scala-lang#scala-reflect;2.10.0!scala-reflect.jar (13041ms)
[info] [SUCCESSFUL ] org.scalamock#scalamock-core_2.10;3.0!scalamock-core_2.10.jar (3670ms)
[info] [SUCCESSFUL ] org.scalatest#scalatest_2.10.0;2.0.M5!scalatest_2.10.0.jar (21710ms)
[info] Done updating.

So it downloads *both* 1.9.1 and 2.0.M5 versions of ScalaTest, without any warning. Needless to say, this confused the user who reported the bug.

What's up, and what can I do to avoid it in the future?

--
paul.butcher->msgCount++

Snetterton, Castle Combe, Cadwell Park...
Who says I have a one track mind?

http://www.paulbutcher.com/
LinkedIn: http://www.linkedin.com/in/paulbutcher
MSN: pa...@paulbutcher.com
AIM: paulrabutcher
Skype: paulrabutcher

Kevin Scaldeferri

unread,
Jan 14, 2013, 10:43:03 AM1/14/13
to simple-b...@googlegroups.com
Note that you have two different artifactIds: "scalatest_2.10.0" and "scalatest_2.10". Generally speaking, I'd say SBT did the right thing here.

-kevin



--
You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To post to this group, send email to simple-b...@googlegroups.com.
To unsubscribe from this group, send email to simple-build-t...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/simple-build-tool?hl=en.

Paul Butcher

unread,
Jan 14, 2013, 10:48:08 AM1/14/13
to simple-b...@googlegroups.com
Ah - so are you saying that the problem is with how ScalaTest was published?

I've just noticed that there's also one published with an artefact ID of scalatest_2.10. I guess that I should move to that.

Thanks!

--
paul.butcher->msgCount++

Snetterton, Castle Combe, Cadwell Park...
Who says I have a one track mind?

http://www.paulbutcher.com/
LinkedIn: http://www.linkedin.com/in/paulbutcher
MSN: pa...@paulbutcher.com
AIM: paulrabutcher
Skype: paulrabutcher

Mark Harrah

unread,
Jan 14, 2013, 5:19:54 PM1/14/13
to simple-b...@googlegroups.com
On Mon, 14 Jan 2013 15:48:08 +0000
Paul Butcher <pa...@paulbutcher.com> wrote:

> Ah - so are you saying that the problem is with how ScalaTest was published?
>
> I've just noticed that there's also one published with an artefact ID of scalatest_2.10. I guess that I should move to that.

Yes, it should be the same jar, just with the right cross-version suffix. sbt can probably at least warn about the situation in the future, though. Could you open a bug for that?

Thanks,
Mark

Paul Butcher

unread,
Jan 14, 2013, 5:27:52 PM1/14/13
to simple-b...@googlegroups.com
On 14 Jan 2013, at 22:19, Mark Harrah <dmha...@gmail.com> wrote:

Yes, it should be the same jar, just with the right cross-version suffix.  sbt can probably at least warn about the situation in the future, though.  Could you open a bug for that?

Reply all
Reply to author
Forward
0 new messages