I'm trying to figure out how to get Travis CI working with my little Java library on Github.
The problem seems to be that whenever the build process gets to the compilation stage, it won't compile the unit tests because it can't seem to find the JUnit jar file. Of course the Ant script works beautifully on my own computer, but I can't get the classpath right on Travis. How am I supposed to know where (or even if) they installed JUnit?
Here's 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's the project link, notice the pretty "build failing" icon. Yay.
https://github.com/The-Craw/PrimeFactorizer
And finally here's the link to the build output. You can also get this from clicking the build icon.
https://travis-ci.org/The-Craw/PrimeFactorizer
You need the junit.jar on your classpath. (I think that is in Ant's lib directory on your locale machine).
You may have a look at the project template https://github.com/mplacona/java-junit-template-project
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With