You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Barry Kaplan <gr...@memelet.com> on 2008/10/21 16:27:27 UTC

How to get surefire to use junit-dep-4.5?

I cannot seem to get surefire to NOT load junit-3.8.1. None of my projects --
directly or transitively -- import junit-3.8.1, yet at runtime surefire adds
it to the classpath (in front of junit-dep-4.5 nonetheless).

Using --debug I can see the dependency tree of each project, none of which
include junit-3.8.1. 

I have added "<junitArtifactName>junit:junit-dep</junitArtifactName>" do the
surefire configuration. I found this via a post, not in any documentation so
I don't really know if it /should/ work.

Any help on resolving this would be greatly appreciated.

-barry
-- 
View this message in context: http://www.nabble.com/How-to-get-surefire-to-use-junit-dep-4.5--tp20091464p20091464.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: How to get surefire to use junit-dep-4.5?

Posted by Barry Kaplan <gr...@memelet.com>.
I'm working with the 2.5/trunk checkout and my own build. I've removed all
the code that selects the various junits and hard-coded junit-dep. YET, I
still get junit-3.8.1 in the "Test Classpath". 

So maybe it some other maven-magic that is adding this jar. I have no idea
even where to begin. I'm even considering adding juniit-dep-4.5 in Nexus
under 3.8.1 and 3.8.2 just to trick maven. Did I mention that surefire will
sometimes add 3.8.1 and other times add 3.8.2. 

If I had a buck for ever hour I've wasted trying to fight maven dependency
management to eradicate junit-3.8.1 (read: no global exclude) I wouldn't
have to code anymore.
-- 
View this message in context: http://www.nabble.com/How-to-get-surefire-to-use-junit-dep-4.5--tp20091464p20099227.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: How to get surefire to use junit-dep-4.5?

Posted by John Stoneham <ly...@lyrically.net>.
> I've even tried the 2.5-SNAPSHOT, which is supposed to address this issue
> -- but still junit-3.8.1 rules the day. I guess its time for some ant
> tasks......

I fought with this for quite a while before giving up and going to the
source code (I was trying to figure out why it wouldn't run my JUnit 4
tests - turns out it was looking at the version of my JUnit dependency,
which I had removed because I was repackaging the classes another way).

Perhaps a look at
http://svn.apache.org/viewvc/maven/surefire/tags/surefire-2.4.3/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java?view=markup
will help illuminate what's going on?

- John

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: How to get surefire to use junit-dep-4.5?

Posted by Barry Kaplan <gr...@memelet.com>.
I've even tried the 2.5-SNAPSHOT, which is supposed to address this issue --
but still junit-3.8.1 rules the day. I guess its time for some ant
tasks......
-- 
View this message in context: http://www.nabble.com/How-to-get-surefire-to-use-junit-dep-4.5--tp20091464p20097148.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org