Source:
private AuthConfig createStandardAuthConfig(boolean isPush, Map authConfigMap, Settings settings, String user, String registry) throws MojoExecutionException { AuthConfig ret; for (LookupMode lookupMode : new LookupMode[] { getLookupMode(isPush), LookupMode.DEFAULT, LookupMode.REGISTRY}) { ret = getAuthConfigFromSystemProperties(lookupMode); if (ret != null) { log.debug("AuthConfig: credentials from system properties"); return ret; } if (lookupMode != LookupMode.REGISTRY) { ret = getAuthConfigFromOpenShiftConfig(lookupMode, authConfigMap); if (ret != null) { log.debug("AuthConfig: OpenShift credentials"); return ret; } } ret = getAuthConfigFromPluginConfiguration(lookupMode, authConfigMap); if (ret != null) { log.debug("AuthConfig: credentials from plugin config"); return ret; } } ret = getAuthConfigFromSettings(settings, user, registry); if (ret != null) { log.debug("AuthConfig: credentials from ~/.m2/setting.xml"); return ret; } if (EcrExtendedAuth.isAwsRegistry(registry)) { try { ret = getAuthConfigFromEC2InstanceRole(); } catch (ConnectTimeoutException ex) { log.debug("Connection timeout while retrieving instance meta-data, likely not an EC2 instance (%s)", ex.getMessage()); } catch (IOException ex) { log.warn("Error while retrieving EC2 instance credentials: %s", ex.getMessage()); } if (ret != null) { log.debug("AuthConfig: credentials from EC2 instance role"); return ret; } } return null; }

Target:
private AuthConfig createStandardAuthConfig(boolean isPush, Map authConfigMap, Settings settings, String user, String registry) throws MojoExecutionException { AuthConfig ret; for (LookupMode lookupMode : new LookupMode[] { getLookupMode(isPush), LookupMode.DEFAULT, LookupMode.REGISTRY}) { ret = getAuthConfigFromSystemProperties(lookupMode); if (ret != null) { log.debug("AuthConfig: credentials from system properties"); return ret; } if (lookupMode != LookupMode.REGISTRY) { ret = getAuthConfigFromOpenShiftConfig(lookupMode, authConfigMap); if (ret != null) { log.debug("AuthConfig: OpenShift credentials"); return ret; } } ret = getAuthConfigFromPluginConfiguration(lookupMode, authConfigMap); if (ret != null) { log.debug("AuthConfig: credentials from plugin config"); return ret; } } ret = getAuthConfigFromSettings(settings, user, registry); if (ret != null) { log.debug("AuthConfig: credentials from ~/.m2/setting.xml"); return ret; } if (EcrExtendedAuth.isAwsRegistry(registry)) { try { ret = getAuthConfigFromEC2InstanceRole(); } catch (ConnectTimeoutException ex) { log.debug("Connection timeout while retrieving instance meta-data, likely not an EC2 instance (%s)", ex.getMessage()); } catch (IOException ex) { log.warn("Error while retrieving EC2 instance credentials: %s", ex.getMessage()); } if (ret != null) { log.debug("AuthConfig: credentials from EC2 instance role"); return ret; } try { ret = getAuthConfigFromECSTaskRole(); } catch (ConnectTimeoutException ex) { log.debug("Connection timeout while retrieving ECS meta-data, likely not an ECS instance (%s)", ex.getMessage()); } catch (IOException ex) { log.warn("Error while retrieving ECS Task role credentials: %s", ex.getMessage()); } if (ret != null) { log.debug("AuthConfig: credentials from ECS Task role"); return ret; } } return null; }