Adapted code for reading ~/.m2/settings.xml.