For example - code coverage tool like Coveralls.io
This is where it got interesting quickly. It's written on the official site that it supports only dynamic languages but nothing about Java. But a quick search in Google pointed me to a maven plugin which connects with Coveralls' API. So I decided to give it a try.
Here are some useful links and hints for everybody trying to do it for his own project:
- Check if your project is Java 8If it is, you have to use the JaCoCo maven plugin, since this is the only code coverage tool supporting Java8 compiled classes. Use at least version than 0.7.0 (according to this bug report)
- Configure it your pom.xml to use JaCoCo
You could use the snippet here but with newer JaCoCo version - Configure in your parent pom.xml to use coveralls-maven-pluginCarefully read the README of the plugin. For security reasons don't publish your token on your repo.
- Update .travis.yml to try to upload your coverage report to Coveralls.io
after_success: mvn clean test jacoco:report coveralls:jacoco - Add cool coverage badge to your README
Like this one:
Congratulations!
You've succesfully integrated: Github + TravisCI + Coveralls.io + JaCoCO for a Java 8 Project
Check out my example project which has successfully integrated all these wonderful systems. https://github.com/leni-kirilov/MoneyTimer
Kudos to Tapio Rautonen for creating such a useful plugin and documenting it in an excellent way!