buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pablo Lalloni <>
Subject ScalaTest 1.4.1 on Scala 1.9.0
Date Fri, 27 May 2011 00:08:51 GMT
Hello everyone,

This is my first email to this maillist so please forgive my lack of
familiarity with local protocols.

Now to the situation... I'm using buildr for the first time ever and using
it for a scala project, in my project I've got some specs and suites written
over scalatest framework setted on buildfile.rb with "test.using :scalatest"

I'm using scala 2.9.0 setted on build.yaml with "scala.version".

In this setting "buildr clean test" fails with:

Downloading org.scala-tools.testing:scalacheck_2.9.0:jar:1.7
Buildr aborted!
RuntimeError : Failed to download
org.scala-tools.testing:scalacheck_2.9.0:jar:1.7, tried the following

I figured out it was because the default version of scalacheck wich gets
used is 1.7 and for that varsion there is no scala 2.9 jar deployed... so I
went and setted "scala.check = 1.9" on build.yaml, then it ended at:

E, [2011-05-26T19:55:32.859152 #10775] ERROR -- : Error instantiating
'scalatest' task: scala.collection.immutable.Set$EmptySet$ cannot be cast to
Test framework error: scala.collection.immutable.Set$EmptySet$ cannot be
cast to scala.collection.generic.Addable
The following tests failed:

After investigation I determined this was because default scalatest jar used
is 1.3 which again is not scala 2.9 compatible... so I added "scala.test =
1.4.1" at build.yaml, then I got:

Downloading org.scalatest:scalatest:jar:1.4.1
Buildr aborted!
RuntimeError : Failed to download org.scalatest:scalatest:jar:1.4.1, tried
the following repositories:

So I've found there's not scalatest 1.4.1 jar deployed on scala-tools repo
without the _2.9.0 artifactId suffix... then I tried to find out how to
customize the scalatest artifactId buildr uses but I've found no way other
than subclassing Scala::Test::ScalaTestFramework using this code:

module Buildr::Scala
  class CustomScalaTest < Buildr::Scala::ScalaTest
    VERSION = "1.4.1"
    class << self
      def dependencies
        ["org.scalatest:scalatest_#{Scala.version}:jar:#{version}"] +
Check.dependencies + JMock.dependencies + JUnit.dependencies

Buildr::TestFramework << Buildr::Scala::CustomScalaTest

test.using :customscalatest

Then everything worked out... testing and everything else.

Is there an easiest way to override default scalatest artifactId that gets

If there isn't... should not this change be on the default
Buildr::Scala::CustomScalaTest? Better yet... should not all the groupId,
artifactId and version of scalatest be parameterized so all can be
customized from build.yaml?

I will be happy to provide a patch if there is interest.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message