Wednesday, June 03, 2015

Traveling back in time

What happens when you go to your parents' house is that you
travel back in time...

It's strange to see all the playgrounds that were once full with kids
and laughter, covered in bushes and trees, so high that makes you
understand just how much time has passed...

You remember times when you laid the foundation of a new football field, nothing of it still remains.
Even the goals are removed and most probably melted as scrap...

Having looked through the window for just a minute, made me travel back in time 10+ years.
And that makes me understand just how insignificant life is, as well as how visible and how powerful it can be - life passed by me and this playground very quickly, events occurred and had a long-lasting effect. Events most probably defined by life ... like those very lively trees that now occupy those grounds!

Entropy, such a short word but describing so many things...
...
A great way to get out of my negative entropy-based chain of thoughts, is to reread Isaac Asimov's "The Last Question". I just love his work and this is one of his best, in my opinion.

Friday, August 15, 2014

Automatic code coverage badge / reports for Java 8 project in Coveralls.io

Recently, I've setup a Java project hosted on Github to get automatically build using TravisCI. It's super cool to have a nice badge saying that your recent builds are green. But then I discovered I could have some more report using free tools like TravisCI.
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:
  1. 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)

  2. Configure it your pom.xml to use JaCoCo
    You could use the snippet here but with newer JaCoCo version
  3. 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.
  4. Update .travis.yml to try to upload your coverage report to Coveralls.io
    after_success: mvn clean test jacoco:report coveralls:jacoco
  5. Add cool coverage badge to your README
    Like this one:  Coverage Status

    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!