'Extract all repositories\'s credentials.
See https://maven.apache.org/settings.html#Servers
:return: List of dict in which one dict contains all information for a repository.'

def extract_repositories_credentials(self):

    repos_creds = []
    maven_settings_file_location = (constant.profile['USERPROFILE'] + '\\.m2\\settings.xml')
    if os.path.isfile(maven_settings_file_location):
        try:
            settings = ET.parse(maven_settings_file_location).getroot()
            server_nodes = settings.findall(('.//%sserver' % self.settings_namespace))
            for server_node in server_nodes:
                creds = {}
                for child_node in server_node:
                    tag_name = child_node.tag.replace(self.settings_namespace, '')
                    if (tag_name in self.nodes_to_extract):
                        creds[tag_name] = child_node.text.strip()
                if (len(creds) > 0):
                    repos_creds.append(creds)
        except Exception as e:
            print_debug('ERROR', ("Cannot    retrieve    repositories    credentials    '%s'" % e))
            pass
    return repos_creds
