Maven错误:(重复)java.security.InvalidAlgorithmParameterException:trustAnchors参数必须为非空 [英] Maven Error: (repeated) java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

查看:3582
本文介绍了Maven错误:(重复)java.security.InvalidAlgorithmParameterException:trustAnchors参数必须为非空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不得不再问一次。有人认为这是一个重复的问题,已经回答并从列表。

Have to ask again. Someone thought it was a duplicate question and already answered and removed it from the list.

我正在使用带有windows的maven(mvn)批处理命令(不是带有eclipse的m2e)来运行全新安装或解决依赖关系。有时,当更改pom.xml时,有必要从我们的nexus服务器下载工件。
这对我来说已经很久了。

I'm using maven (mvn) batch command with windows (not m2e with eclipse) to run clean install or resolve dependencies. Sometimes, when pom.xml was changed, it is necessary to download artifacts from our nexus server. This used to work for long time for me.

但现在连接到nexus服务器(https,服务器使用公司拥有的证书)失败了 java.security.InvalidAlgorithmParameterException:trustAnchors参数必须为非空
我知道,我更改了Java版本。但我很确定我维护cacerts密钥库的方式与之前版本相同。 (在租用时我比较了两个cacerts中的指纹;它们是相同的)。

But now the connection to the nexus server (https, the server uses a company owned certificate) fails with "java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty" I know, I changed the Java release. But I'm pretty sure I maintained the cacerts keystore the same way I did with the previous releases. (at leased I compared the fingerprints in both of the cacerts; they are the same).

当运行命令时
mvn -s - Djavax.net.debug = all -Djava.net.ssl.trustStore =C:/Programme/Java/jre1.8.0_102/lib/security/cacerts-Djavax.net.ssl.trustStorePassword = changeit dependency:resolve ,ssl-trace说:

When running the command "mvn -s -Djavax.net.debug=all -Djava.net.ssl.trustStore="C:/Programme/Java/jre1.8.0_102/lib/security/cacerts" -Djavax.net.ssl.trustStorePassword=changeit dependency:resolve", the ssl-trace says:

keyStore is :    
keyStore type is : jks
keyStore provider is : 
init keystore
init keymanager of type SunX509
trustStore is: No File Available, using empty keystore.
trustStore type is : jks
trustStore provider is : 
init truststore

即使在命令中指定密钥库的路径和密码,ssl跟踪中的答案也是找不到它。

Even if specifying the path and the password of the keystore in the command, the answer in the ssl trace is that it could not be found.

我不知道为了解决这个问题我可能会改变什么。我更改了Windows PATH-Statement,但这与前面描述的命令无关。
任何提示都很受欢迎

I've no idea what I might have changed to get to this trouble. I changed the Windows PATH-Statement, but this should not matter fro the previously described command. Any hint is appreciated

推荐答案

我遇到了同样的问题,我花了一天时间来解决它。
这是一个java相关的问题,你可以在错误堆栈中看到。
签入:

I had the same issue and it took me a day to solve it. This a java related issue as you may see in the error stack. Check in:

/ etc / ssl / certs / java cacerts 文件。< br>
1)如果你这里没有这个文件那就是你得到这个错误的原因

2)如果你这里有这个文件,那就意味着这可能不是有效的cacerts文件。

/etc/ssl/certs/java for the cacerts file.
1) If you don't have this file here that is the reason why your getting this error
2) If you do have this file here it means that this is probably not a valid cacerts file.

如果您需要,可以使用以下命令进行更新:

sudo apt-get install --reinstall ca -certificates

如果它现在有效,那么完美(在我的情况下它不起作用)

If you want you can update it with:
sudo apt-get install --reinstall ca-certificates
And if it works now, then perfect (in my case it did not work)

所以到解决这个问题:


  1. 直接从oracle
    提取tar.gz文件

  2. jre / lib / security
  3. $下找到新的有效 cacerts 文件b $ b
  4. 将此文件复制到 / etc / ssl / certs / java (如果是这种情况,请删除旧文件)

  1. Download from open-jdk8 (in my case) directly from oracle
  2. Extract the tar.gz files
  3. Find the new valid cacerts file under jre/lib/security
  4. Copy this file to /etc/ssl/certs/java (removing the old one if that is your case)

最后运行导致你出现此错误的命令,希望它消失了!
希望这会有所帮助。

Finally run the comand that caused you this error and hopefully its gone! Hope this helped.

干杯

这篇关于Maven错误:(重复)java.security.InvalidAlgorithmParameterException:trustAnchors参数必须为非空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆