diff --git a/src/main/java/de/eitco/cicd/dotnet/InitializeMojo.java b/src/main/java/de/eitco/cicd/dotnet/InitializeMojo.java index 0b60951..26c6ddc 100644 --- a/src/main/java/de/eitco/cicd/dotnet/InitializeMojo.java +++ b/src/main/java/de/eitco/cicd/dotnet/InitializeMojo.java @@ -26,9 +26,16 @@ public void execute() throws MojoExecutionException { String key = entry.getKey(); String value = entry.getValue(); - Server server = findServer(key); + Server server = settings.getServer(key); - dotnetExecutor.upsertNugetSource(value, key, decrypt(server.getUsername()), decrypt(server.getPassword()), null); + if (server == null) { + + dotnetExecutor.upsertNugetSource(value, key, null, null, null); + + } else { + + dotnetExecutor.upsertNugetSource(value, key, decrypt(server.getUsername()), decrypt(server.getPassword()), null); + } } }