That’s my point: you should prevent the NPE. 

I will fix that. 

Regards 
JB

> Le 12 avr. 2021 à 21:00, Freeman Fang <[email protected]> a écrit :
> 
> 
> Hi Paul,
> 
> This is caused by that you don't have ~/.m2/settings.xml, so mavenSettings is 
> null. We need to add a NPE guard here.
> 
> Freeman
> 
>> On Mon, Apr 12, 2021 at 2:43 PM Paul Spencer <[email protected]> 
>> wrote:
>> Karaf 4.2.11
>> Java  1.8.0_282
>> OS    Redhat 8.2
>> 
>> Starting with a virgin Karaf 4.2.11 installation, I added my own repository 
>> and I attempted to remove the default remote repositories.
>> Removing the repository id central fails with a NPE.  Why?
>> 
>> karaf@root()> maven:repository-add -id myrepo http://myrepo.example.com
>> karaf@root()> maven:repository-remove -id central
>> Are you sure to remove repository with ID "central" for URL 
>> https://repo1.maven.org/maven2/? (y/N) y
>> null
>> karaf@root()>
>> 
>> ***
>> * From karaf.log
>> ***
>> 14:16:28.422 WARN [pipe-maven:repository-remove -id central] The Parser of 
>> class 
>> org.apache.karaf.shell.impl.console.ConsoleSessionImpl$$Lambda$411/734988569 
>> does not support the CompletingParsedLine interface. Completion with escaped 
>> or quoted words won't work correctly.
>> 14:16:30.081 ERROR [pipe-maven:repository-remove -id central] null
>> java.lang.NullPointerException: null
>>         at 
>> org.apache.karaf.maven.command.RepositoryRemoveCommand.edit(RepositoryRemoveCommand.java:73)
>>  ~[!/:?]
>>         at 
>> org.apache.karaf.maven.command.RepositoryEditCommandSupport.doAction(RepositoryEditCommandSupport.java:65)
>>  ~[!/:?]
>>         at 
>> org.apache.karaf.maven.command.MavenConfigurationSupport.execute(MavenConfigurationSupport.java:161)
>>  [!/:?]
>>         at 
>> org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84)
>>  [!/:4.2.11]
>>         at 
>> org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68)
>>  [!/:4.2.11]
>>         at 
>> org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86)
>>  [!/:4.2.11]
>>         at 
>> org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599) 
>> [!/:4.2.11]
>>         at 
>> org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526) 
>> [!/:4.2.11]
>>         at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415) 
>> [!/:4.2.11]
>>         at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416) 
>> [!/:4.2.11]
>>         at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) [!/:4.2.11]
>>         at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) [!/:4.2.11]
>>         at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
>> [?:1.8.0_282]
>>         at 
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>>  [?:1.8.0_282]
>>         at 
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>>  [?:1.8.0_282]
>>         at java.lang.Thread.run(Thread.java:748) [?:1.8.0_282]
>> 
>> 
>> Paul Spencer

Reply via email to