refactored to tidy up script
setup for offline maven usage