You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2021/05/05 04:54:40 UTC
[karaf] branch karaf-4.2.x updated: [KARAF-7101] Prevent NPE when
~/.m2/settings.xml doesn't exist
This is an automated email from the ASF dual-hosted git repository.
jbonofre pushed a commit to branch karaf-4.2.x
in repository https://gitbox.apache.org/repos/asf/karaf.git
The following commit(s) were added to refs/heads/karaf-4.2.x by this push:
new 1d12d4c [KARAF-7101] Prevent NPE when ~/.m2/settings.xml doesn't exist
1d12d4c is described below
commit 1d12d4c8e2fab8dee1eb957ff3bc26fe242f8233
Author: jbonofre <jb...@apache.org>
AuthorDate: Tue May 4 18:39:49 2021 +0200
[KARAF-7101] Prevent NPE when ~/.m2/settings.xml doesn't exist
(cherry picked from commit bb00116f4bc70d58e7f0d8a0576ca8296040900f)
---
.../java/org/apache/karaf/maven/command/RepositoryRemoveCommand.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/maven/core/src/main/java/org/apache/karaf/maven/command/RepositoryRemoveCommand.java b/maven/core/src/main/java/org/apache/karaf/maven/command/RepositoryRemoveCommand.java
index 28c0716..1171e96 100644
--- a/maven/core/src/main/java/org/apache/karaf/maven/command/RepositoryRemoveCommand.java
+++ b/maven/core/src/main/java/org/apache/karaf/maven/command/RepositoryRemoveCommand.java
@@ -70,7 +70,7 @@ public class RepositoryRemoveCommand extends RepositoryEditCommandSupport {
updatePidRepositories(prefix, config, defaultRepository, newRepos, settingsRepos.length > 0);
// if there are credentials for this repository, we have to remove them from settings.xml
- if (mavenSettings.getServers().stream().anyMatch((s) -> id.equals(s.getId()))) {
+ if (mavenSettings != null && mavenSettings.getServers().stream().anyMatch((s) -> id.equals(s.getId()))) {
// remove <server> (credentials) if available
List<Server> newServers = mavenSettings.getServers().stream()
.filter((s) -> !id.equals(s.getId())).collect(Collectors.toList());