multiple versions of ant detected in path for junit

1,853 views
Skip to first unread message

Som Snytt

unread,
Oct 4, 2014, 12:35:14 PM10/4/14
to scala-internals
This warning in the build is probably not desirable.  I haven't checked whether it is benign.  Has this come up already?  Officially myrmecophobe again.

test.junit:
     [echo] Note: details of failed tests will be output to /localhome/jenkins/c/workspace/pr-scala-test/scala/build/junit
    [junit] WARNING: multiple versions of ant detected in path for junit
    [junit]          jar:file:/home/jenkins/apps/ant/lib/ant.jar!/org/apache/tools/ant/Project.class
    [junit]      and jar:file:/localhome/jenkins/c/workspace/pr-scala-test/m2repo/org/apache/ant/ant/1.8.4/ant-1.8.4.jar!/org/apache/tools/ant/Project.class
    [junit] Running scala.StringContextTest
    [junit] Tests run: 13, Failures: 0, Errors: 0, Time elapsed: 0.114 sec


I have a test failure to run down, with strange output where one result is double-output.

test.junit:
     [echo] Note: details of failed tests will be output to /home/apm/projects/snytt/build/junit
    [junit] WARNING: multiple versions of ant detected in path for junit
    [junit]          jar:file:/usr/share/ant/lib/ant.jar!/org/apache/tools/ant/Project.class
    [junit]      and jar:file:/home/apm/.m2/repository/org/apache/ant/ant/1.8.4/ant-1.8.4.jar!/org/apache/tools/ant/Project.class
    [junit] Running NumericTest
    [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.171 sec
    [junit] Running scala.StringContextTest
    [junit] Tests run: 13, Failures: 0, Errors: 0, Time elapsed: 0.201 sec
    [junit] Running scala.collection.IndexedSeqOptimizedTest
    [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.202 sec
    [junit] Running scala.collection.IteratorTest
    [junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 0.213 sec
    [junit] Running scala.collection.SetMapConsistencyTest
    [junit] Tests run: 13, Failures: 0, Errors: 0, Time elapsed: 6.347 sec
    [junit] Running scala.collection.TraversableOnceTest
    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.228 sec
    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.228 sec
    [junit] Running scala.collection.convert.MapWrapperTest
    [junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 0.191 sec
    [junit] Running scala.collection.immutable.PagedSeqTest
    [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.229 sec
    [junit] Running scala.collection.immutable.QueueTest
    [junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 0.191 sec
    [junit] Running scala.collection.immutable.RangeConsistencyTest
    [junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 1.407 sec
    [junit] Running scala.collection.immutable.StreamTest
    [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.197 sec
    [junit] Running scala.collection.mutable.ArraySortingTest
    [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.212 sec
    [junit] Running scala.collection.mutable.PriorityQueueTest
    [junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 0.343 sec
    [junit] Running scala.collection.mutable.VectorTest
    [junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 0.266 sec
    [junit] Running scala.concurrent.impl.DefaultPromiseTest
    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 3.051 sec
    [junit] Running scala.math.BigDecimalTest
    [junit] Tests run: 9, Failures: 0, Errors: 0, Time elapsed: 1.407 sec
    [junit] Running scala.reflect.QTest
    [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 1.908 sec
    [junit] Running scala.reflect.internal.MirrorsTest
    [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 1.932 sec
    [junit] Running scala.reflect.internal.NamesTest
    [junit] Tests run: 7, Failures: 0, Errors: 0, Time elapsed: 0.919 sec
    [junit] Running scala.reflect.internal.PrintersTest
    [junit] Tests run: 180, Failures: 0, Errors: 155, Time elapsed: 3.997 sec

Simon Ochsenreither

unread,
Oct 4, 2014, 1:11:10 PM10/4/14
to scala-i...@googlegroups.com
I see the same warning, no idea when it was introduced.
Deleting one of the jar files doesn't help.

Antoine Gourlay

unread,
Oct 6, 2014, 6:35:26 AM10/6/14
to scala-i...@googlegroups.com
This is because things from partest-extras are used in junit tests, and partest depends on ant. The ant runner propagates itself to the forked jvm that runs the tests, so you end up with two (different) versions of ant on the classpath (and the one from partest is pretty old...).

It seems benign, but you never know.

The only class from partest-extras used in the tests is `scala.tools.partest.ASMConverters`, and it doesn't even depend on partest or ant at all. It could be moved out of partest-extras into something else. I am not sure where that should be though...


On Sat, Oct 4, 2014 at 7:11 PM, Simon Ochsenreither <simon.och...@gmail.com> wrote:
I see the same warning, no idea when it was introduced.
Deleting one of the jar files doesn't help.

--
You received this message because you are subscribed to the Google Groups "scala-internals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-interna...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Adriaan Moors

unread,
Oct 7, 2014, 4:01:06 AM10/7/14
to scala-i...@googlegroups.com
Thanks for figuring that out! I'm open to all kinds of fixes here :-)

Maybe the easiest is to mark the ant dependency in partest as 'provided'?
We'll have to make sure to change the runner script to supply it.

Maybe we could alternatibely split out partest's ant functionality into a separate module?

Antoine Gourlay

unread,
Oct 7, 2014, 5:41:14 AM10/7/14
to scala-i...@googlegroups.com

On Tue, Oct 7, 2014 at 10:00 AM, Adriaan Moors <adr...@typesafe.com> wrote:
Maybe the easiest is to mark the ant dependency in partest as 'provided'?
We'll have to make sure to change the runner script to supply it.

Actually there is no need to change the runner script or anything, marking it as provided "just works" :)

https://github.com/scala/scala-partest/pull/23

Adriaan Moors

unread,
Oct 7, 2014, 8:11:33 AM10/7/14
to scala-i...@googlegroups.com
Indeed. Thanks for the quick fix! It's the less glamorous fixes like this one that help make the whole project tick.

--

Antoine Gourlay

unread,
Oct 7, 2014, 9:11:39 AM10/7/14
to scala-i...@googlegroups.com
I found less glamorous fixes to be a good way to get to know the internals (of the build system, in this case) while still actually producing something useful :)

That being said, I long for the day when the ant build is put to death and we can have good incremental recompilation...

Adriaan Moors

unread,
Oct 7, 2014, 10:16:51 AM10/7/14
to scala-i...@googlegroups.com

On Tue, Oct 7, 2014 at 3:11 PM, Antoine Gourlay <ant...@gourlay.fr> wrote:
That being said, I long for the day when the ant build is put to death and we can have good incremental recompilation...

+1! I've been enjoying said incremental compilation thanks to Scala IDE 4 nightlies for a while now -- highly recommended.

Grzegorz is working on an official sbt build.

Reply all
Reply to author
Forward
0 new messages