ported solution for issue #65 by @saladinkzn to gretty-runner-tomcat8