static void configureWagon(Wagon wagon, String repositoryId, Settings settings, PlexusContainer container,
Log log)
throws WagonConfigurationException {
// MSITE-25: Make sure that the server settings are inserted
for (int i = 0; i < settings.getServers().size(); i++) {
Server server = (Server) settings.getServers().get(i);
String id = server.getId();
if (id != null && id.equals(repositoryId)) {
if (server.getConfiguration() != null) {
final PlexusConfiguration plexusConf =
new XmlPlexusConfiguration((Xpp3Dom) server.getConfiguration());
ComponentConfigurator componentConfigurator = null;
try {
componentConfigurator = (ComponentConfigurator) container.lookup(ComponentConfigurator.ROLE);
componentConfigurator.configureComponent(wagon, plexusConf, container.getContainerRealm());