gpt4 book ai didi

Maven Wagon SCP 无法建立连接

转载 作者:行者123 更新时间:2023-12-01 19:35:50 30 4
gpt4 key购买 nike

我正在尝试将资源复制到另一个位置。我正在使用 maven wagon-ssh 插件来执行此操作。它在本地工作正常,我在使用 Hudson/Jenkins 时遇到问题。

我的 settings.xml 文件如下所示:

<servers>
<server>
<id>iq</id>
<configuration>
<knownHostsProvider implementation="org.apache.maven.wagon.providers.ssh.knownhost.NullKnownHostProvider">
<hostKeyChecking>no</hostKeyChecking>
</knownHostsProvider>
</configuration>
<username>user</username>
<password>pass</password>
</server>
</servers>

我试过this answer to skipping checking正如我得到的:

Are you sure you want to continue connecting? (yes/no): The authenticity of host 'address' can't be established.
RSA key fingerprint is 10:.......:bb.

但现在我得到:

Could not apply configuration for iq to wagon org.apache.maven.wagon.providers.ssh.jsch.ScpWagon:ClassNotFoundException: Class name which was explicitly given in configuration using 'implementation' attribute: 'org.apache.maven.wagon.providers.ssh.knownhost.NullKnownHostProvider' cannot be loaded
org.codehaus.plexus.component.configurator.ComponentConfigurationException: ClassNotFoundException: Class name which was explicitly given in configuration using 'implementation' attribute: 'org.apache.maven.wagon.providers.ssh.knownhost.NullKnownHostProvider' cannot be loaded
at org.codehaus.plexus.component.configurator.converters.AbstractConfigurationConverter.getClassForImplementationHint(AbstractConfigurationConverter.java:70)
at .....

Caused by: java.lang.ClassNotFoundException: org.apache.maven.wagon.providers.ssh.knownhost.NullKnownHostProvider
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
at org.codehaus.plexus.component.configurator.converters.AbstractConfigurationConverter.getClassForImplementationHint(AbstractConfigurationConverter.java:61)
... 37 more
The authenticity of host 'address' can't be established.
RSA key fingerprint is 10:.......:bb.
Are you sure you want to continue connecting? (yes/no): The authenticity of host 'address' can't be established.

最佳答案

maven 显然需要 jenkins 用户的 known_hosts 文件中的 ssh-rsa 条目。您可以通过发出以下命令将 ssh-rsa 条目添加到文件中:

ssh-keyscan -t rsa YOUR_REMOTE_HOSTNAME >> ~jenkins/.ssh/known_hosts
<小时/>

[[从另一个答案中添加,以使这个答案明确。 ]]

相反,您可以将以下内容添加到 ~jenkins/.ssh/config 中。请参阅:How to Avoid Maven builds stall on ssh host authenticity problem?

StrictHostKeyChecking no

关于Maven Wagon SCP 无法建立连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8323040/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com