How do I make Jenkins find JUnit when building with Ant?
Reading the answers here and here I believe I have a classpath issue, but I am unable to solve it. In my Netbeans project I have a single JUnit test which runs fine in Netbeans. I push the project to my Git repo and Jenkins sees the change and builds the project, but I get a bunch of errors (below) because JUnit is not found.
-do-compile-test:
[javac] Compiling 1 source file to C:\Jenkins\jobs\demo\workspace\demo\build\test\classes
[javac] C:\Jenkins\jobs\demo\workspace\demo\test\MainTest.java:6: package org.junit does not exist
[javac] import org.junit.After;
[javac] ^
[javac] C:\Jenkins\jobs\demo\workspace\demo\test\MainTest.java:7: package org.junit does not exist
[javac] import org.junit.AfterClass;
[javac]
^
JUnit is in my %ANT_HOME%\lib
directory (Windows 7 64 bit). The file structure for my Netbeans project is like this:
I have tried to edit the classpath via Ant as discussed here, but I cannot get it working right.
This is my first go with Ant, JUnit, and Jenkins, but I think I'm really close to getting it all working correctly with Netbeans and Git. I will gladly provide more info. Been fighting this for 3 days now, so any assistance would be greatly appreciated.