I am trying to figure out how to get Travis CI to work with my small Java library on Github.
The problem is that whenever the build process goes to the compilation stage, it will not compile unit tests because it cannot find the JUnit jar file. Of course, the Ant script works fine on my own computer, but I cannot get the classpath directly on Travis. How should I know where (or even if) they installed JUnit?
Here is my Ant script:
<project> <target name="test"> <delete dir="build" /> <mkdir dir="build" /> <javac includeantruntime="false" srcdir="src" destdir="build" /> <javac includeantruntime="false" srcdir="tests" destdir="build" classpath="/usr/share/java/junit.jar" /> <junit printsummary="on"> <classpath> <pathelement location="build" /> <pathelement path="/usr/share/java" /> </classpath> <test name="FactorizeTest" /> </junit> </target> </project>
Here is the project link, pay attention to the nice "build failing" icon. Yay
https://github.com/The-Craw/PrimeFactorizer
And finally, a link to the output of the assembly. You can also get this by clicking the build icon.
https://travis-ci.org/The-Craw/PrimeFactorizer
source share