Modified script to allow Java packages to set Resource directory