buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Assaf Arkin" <ar...@intalio.com>
Subject Re: Override JUnit version in 1.3.0
Date Tue, 20 May 2008 03:53:20 GMT
On Mon, May 19, 2008 at 7:21 PM, dhpeterson <dhpeterson@gmail.com> wrote:

>
>
>
> I'm using this one:
>
> http://repo1.maven.org/maven2/junit/junit/4.4/
>
> All I want to do is force Buildr to use JUnit 4.4 for testing. I use a
> Spring test runner class that depends on it!
>
> In 1.2.10 I hacked the JUNIT_VERSION directly in buildr/test.rb but I am
> sure there is a better way in 1.3.0 - especially since the source seems to
> suggest "VERSION" can be overridden. I just don't know how :)


Unfortunately not for JUnit, we eagerly set the dependency and load the JAR
ahead of the buildfile, so by the time you get to change it, too late.

This came up in relation to XML Beans [1], and we got a couple of ideas to
play around with. I have not tried it with JUnit, but I believe both
mechanisms would work.  One would be to delay loading of JUnit and use
Artifact namespaces to override the default version, Victor would be able to
explain this better.  The other would be to use the build.yaml file to
specify a different version for JUnit, and have Buildr look there first
before using the default.  build.yaml might read something like:

junit: 4.4

Or, we can pick an artifact by its name, using build.yaml to specify the
actual artifact:

artifacts:
  junit: junit:junit:jar:4.4

Assaf

[1] http://issues.apache.org/jira/browse/BUILDR-4


>
>
> Dave
>
>
>
> Daniel Spiewak wrote:
> >
> > JUnit 4.4 isn't in the Maven repositories (that I could find).  I
> > "solved" the problem by downloading the junit-4.4 JAR, renaming it to
> > "junit-4.3.1.jar" and then copying it over the JAR in
> > ~/.m2/repository/junit/junit-4.3.1/  :-)
> >
> > Probably not the best solution, that.
> >
> > Daniel
> >
> > dhpeterson wrote:
> >> Hi all,
> >>
> >> How do I override the version of JUnit in buildr 1.3.0. It still uses
> >> 4.3.1
> >> but I want to force it to use JUnit 4.4 within my Rakefile.
> >>
> >> I've tried:
> >>
> >> Buildr::JUnit::VERSION = 4.4
> >>
> >> and a bunch of other things, to no effect.
> >>
> >> Thanks in advance.
> >>
> >> Dave
> >>
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Override-JUnit-version-in-1.3.0-tp17331761p17331993.html
> Sent from the Buildr - User mailing list archive at Nabble.com.
>
>

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