'Detect if a Master password exists and then extract it.
See https://maven.apache.org/guides/mini/guide-encryption.html#How_to_create_a_master_password
:return: The master password value or None if no master password exists.'

def extract_master_password(self):

    master_password = None
    master_password_file_location = (constant.profile['USERPROFILE'] + '\\.m2\\settings-security.xml')
    if os.path.isfile(master_password_file_location):
        try:
            config = ET.parse(master_password_file_location).getroot()
            master_password_node = config.find('.//master')
            if (master_password_node is not None):
                master_password = master_password_node.text
        except Exception as e:
            print_debug('ERROR', ("Cannot    retrieve    master    password    '%s'" % e))
            master_password = None
    return master_password
