improve gradle build file to start rmi registry service