use of org.jenkinsci.test.acceptance.plugins.config_file_provider.ServerCredentialMapping in project acceptance-test-harness by jenkinsci.
the class ConfigFileProviderTest method createMavenSettingsConfig.
private MavenSettingsConfig createMavenSettingsConfig(final String serverId, final String credId) {
final MavenSettingsConfig mvnConfig = new ConfigFileProvider(jenkins).addFile(MavenSettingsConfig.class);
mvnConfig.content(String.format("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<settings xmlns=\"http://maven.apache.org/SETTINGS/1.0.0\" \n" + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \n" + " xsi:schemaLocation=\"http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd\">\n" + " \n" + " <servers>\n" + " <server>\n" + " <id>%s</id>\n" + " </server>\n" + " </servers>\n" + "\n" + "</settings>", serverId));
final ServerCredentialMapping serverCred = mvnConfig.addServerCredentialMapping();
serverCred.serverId(serverId);
serverCred.credentialsId(credId);
mvnConfig.save();
return mvnConfig;
}
Aggregations