Modified script to allow java packages to set Resource directory(Part 2)