Moving the java code to src/main/groovy to eliminate circular dependency