Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows ant build failure on junit dependency #76

Closed
GoogleCodeExporter opened this issue Mar 29, 2015 · 4 comments
Closed

Windows ant build failure on junit dependency #76

GoogleCodeExporter opened this issue Mar 29, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Download and configure Ant 1.9.0 (set ANT_HOME and PATH) on Windows.
2. Run ant from the directory where the clone of EqualsVerifier resides.

This results in the following output:

D:\Users\Tonni\Documents\GitHub\equalsverifier>ant
Buildfile: D:\Users\Tonni\Documents\GitHub\equalsverifier\build.xml

clean:

download-ivy:
      [get] Getting: http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.1.0/ivy-
2.1.0.jar
      [get] To: D:\Users\Tonni\.ant\lib\ivy.jar
      [get] Not modified - so not downloaded

init-ivy:

resolve-dependencies:
[ivy:retrieve] :: Ivy 2.1.0 - 20090925235825 :: http://ant.apache.org/ivy/ ::
[ivy:retrieve] :: loading settings :: url = jar:file:/D:/Users/Tonni/.ant/lib/iv
y.jar!/org/apache/ivy/core/settings/ivysettings.xml
[ivy:retrieve] :: resolving dependencies :: nl.jqno.equalsverifier#equalsverifie
r;working@WunderWaffe
[ivy:retrieve]  confs: [runtime, test, deploy]
[ivy:retrieve]  found cglib#cglib-nodep;2.2 in public
[ivy:retrieve]  found org.objenesis#objenesis;1.1 in public
[ivy:retrieve]  found junit#junit;4.10 in public
[ivy:retrieve]  found org.hamcrest#hamcrest-core;1.1 in public
[ivy:retrieve]  found org.apache.maven#maven-ant-tasks;2.1.3 in public
[ivy:retrieve]  found org.apache.ant#ant;1.8.0 in public
[ivy:retrieve]  found org.apache.ant#ant-launcher;1.8.0 in public
[ivy:retrieve]  found classworlds#classworlds;1.1-alpha-2 in public
[ivy:retrieve]  found org.codehaus.plexus#plexus-container-default;1.0-alpha-9-s
table-1 in public
[ivy:retrieve]  found org.codehaus.plexus#plexus-utils;1.5.15 in public
[ivy:retrieve]  found org.codehaus.plexus#plexus-interpolation;1.11 in public
[ivy:retrieve]  found org.apache.maven#maven-artifact;2.2.1 in public
[ivy:retrieve]  found org.apache.maven#maven-artifact-manager;2.2.1 in public
[ivy:retrieve]  found org.apache.maven#maven-repository-metadata;2.2.1 in public

[ivy:retrieve]  found org.apache.maven.wagon#wagon-provider-api;1.0-beta-6 in pu
blic
[ivy:retrieve]  found backport-util-concurrent#backport-util-concurrent;3.1 in p
ublic
[ivy:retrieve]  found org.apache.maven#maven-model;2.2.1 in public
[ivy:retrieve]  found org.apache.maven#maven-project;2.2.1 in public
[ivy:retrieve]  found org.apache.maven#maven-settings;2.2.1 in public
[ivy:retrieve]  found org.apache.maven#maven-profile;2.2.1 in public
[ivy:retrieve]  found org.apache.maven#maven-plugin-registry;2.2.1 in public
[ivy:retrieve]  found org.apache.maven#maven-error-diagnostics;2.2.1 in public
[ivy:retrieve]  found org.apache.maven.wagon#wagon-file;1.0-beta-6 in public
[ivy:retrieve]  found org.apache.maven.wagon#wagon-http-lightweight;1.0-beta-6 i
n public
[ivy:retrieve]  found org.apache.maven.wagon#wagon-http-shared;1.0-beta-6 in pub
lic
[ivy:retrieve]  found nekohtml#xercesMinimal;1.9.6.2 in public
[ivy:retrieve]  found nekohtml#nekohtml;1.9.6.2 in public
[ivy:retrieve] :: resolution report :: resolve 769ms :: artifacts dl 21ms
[ivy:retrieve]  :: evicted modules:
[ivy:retrieve]  org.codehaus.plexus#plexus-utils;1.0.4 by [org.codehaus.plexus#p
lexus-utils;1.5.15] in [deploy]
        ---------------------------------------------------------------------
        |                  |            modules            ||   artifacts   |
        |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
        ---------------------------------------------------------------------
        |      runtime     |   2   |   0   |   0   |   0   ||   2   |   0   |
        |       test       |   4   |   0   |   0   |   0   ||   4   |   0   |
        |      deploy      |   26  |   0   |   0   |   1   ||   25  |   0   |
        ---------------------------------------------------------------------
[ivy:retrieve] :: retrieving :: nl.jqno.equalsverifier#equalsverifier
[ivy:retrieve]  confs: [runtime, test, deploy]
[ivy:retrieve]  0 artifacts copied, 27 already retrieved (0kB/40ms)

compile:
    [mkdir] Created dir: D:\Users\Tonni\Documents\GitHub\equalsverifier\build\sr
c
    [javac] Compiling 26 source files to D:\Users\Tonni\Documents\GitHub\equalsv
erifier\build\src
    [javac] warning: [options] bootstrap class path not set in conjunction with
-source 1.5
    [javac] D:\Users\Tonni\Documents\GitHub\equalsverifier\src\nl\jqno\equalsver
ifier\util\Instantiator.java:100: warning: [rawtypes] found raw type: Class
    [javac]                     e.setInterfaces(new Class[] { superclass });
    [javac]                                         ^
    [javac]   missing type arguments for generic class Class<T>
    [javac]   where T is a type-variable:
    [javac]     T extends Object declared in class Class
    [javac] 2 warnings

compileTest:
    [mkdir] Created dir: D:\Users\Tonni\Documents\GitHub\equalsverifier\build\te
st
    [javac] Compiling 87 source files to D:\Users\Tonni\Documents\GitHub\equalsv
erifier\build\test
    [javac] warning: [options] bootstrap class path not set in conjunction with
-source 1.5
    [javac] 1 warning

test:
    [mkdir] Created dir: D:\Users\Tonni\Documents\GitHub\equalsverifier\dist\tes
treports

BUILD FAILED
D:\Users\Tonni\Documents\GitHub\equalsverifier\build.xml:140: java.lang.NoClassD
efFoundError: junit/framework/TestResult
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:14
2)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
        at org.apache.tools.ant.AntClassLoader.findBaseClass(AntClassLoader.java
:1385)
        at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:106
4)
        at org.apache.tools.ant.util.SplitClassLoader.loadClass(SplitClassLoader
.java:58)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTaskMirrorImpl.newJ
UnitTestRunner(JUnitTaskMirrorImpl.java:66)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeInVM(JU
nitTask.java:1390)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitT
ask.java:848)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeOrQueue
(JUnitTask.java:1899)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitT
ask.java:800)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:435)
        at org.apache.tools.ant.Target.performTasks(Target.java:456)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
        at org.apache.tools.ant.Main.runBuild(Main.java:851)
        at org.apache.tools.ant.Main.startAnt(Main.java:235)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.lang.ClassNotFoundException: junit.framework.TestResult
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
        ... 36 more

Total time: 5 seconds

Original issue reported on code.google.com by [email protected] on 18 Mar 2013 at 6:08

@GoogleCodeExporter
Copy link
Author

It turned out to be an issue with Ant 1.9, not Windows. On my Linux machine it 
worked, but I was still on Ant 1.8. (1.9 was released this month.)

I'm still not completely sure why it fails. It might be because EV has a 
transitive dependency on Ant 1.8 (because of the maven-ant-tasks module), but 
the problem persisted when I removed it.

Anyway, I've added a fork="true" attribute to the <junit> task, which seems to 
fix it. I'm don't really want to spend much more time on this, so I'm closing 
the issue now :).

Original comment by [email protected] on 23 Mar 2013 at 1:30

  • Changed state: Fixed
  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Thanks a lot bro.. 
I too had the same problem, fork='true' resolved it
Please do drop a reply if u know what does fork='true' implies

Original comment by [email protected] on 6 May 2013 at 9:57

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

It forks a new process; i.e. executes the compile in a different JVM than the 
one that's running Ant. Among other things, you'll get a "clean" CLASSPATH.

Original comment by [email protected] on 6 May 2013 at 11:19

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

thanks a lot jan

Original comment by [email protected] on 6 May 2013 at 3:09

  • Added labels: ****
  • Removed labels: ****

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant