Maven Wagon 插件可以使用 scp 私钥吗?
Maven Wagon 插件可以配置为使用 ssh/scp 私钥吗?我尝试过的所有操作仍然让 maven 在进行 scp 时询问我密码。
Can Maven Wagon plugin be configured to use a private key for ssh/scp? Everything I've tried still leaves maven to ask me for a password when it gets to the point of scp-ing.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您应该能够在设置中的 server 元素中指定私钥的路径.xml:
请特别注意“注意”:如果您使用私钥登录服务器,请确保省略
元素。否则,该键将被忽略。因此最终配置将接近:You should be able to specify the path to the private key in the server element in your settings.xml:
Pay a special attention to the "note": If you use a private key to login to the server, make sure you omit the
<password>
element. Otherwise, the key will be ignored. So the final configuration will be close to:我知道这是一个旧线程,但看起来 Wagon 插件正在读取 settings.xml (例如用户名)但没有使用所有设置。我无法让它在 scp 期间停止询问 Kerberos 用户名/密码。 (看起来 2016 年末插件可能发生了一些变化,影响了这一点。)
只是添加这个答案以防它对其他人有帮助。
对我来说,解决方案更简单:完全跳过使用“settings.xml”
并简单地为协议指定“scpexe”而不是“scp”(例如在 pom.xml 的 distributionManagement 部分下)。然后,这将使用您计算机的默认 SSH 配置(~/.ssh 下的 UNIX 设置)。
I know this is an old thread, but it looks like the Wagon plugin is reading settings.xml (e.g. username) but not using all of the settings. I could not get it to stop asking for Kerberos username/password during scp. (Looks like there might have been changes to plugin late 2016 that affect this.)
Just adding this answer in case it helps someone else.
For me, the solution was even simpler: totally skip using 'settings.xml'
and simply specify 'scpexe' instead of 'scp' for protocol (like under distributionManagement section of pom.xml). This then uses your machine's default SSH configuration (unix settings under ~/.ssh).
我今天想结合 maven-site-plugin (3.9.1) 做同样的事情,并且也遇到了一些障碍(特别是 wagon-ssh插件坚持要求我提供 Kerberos 用户名和密码)。
最终对 wagon-ssh-3.4.3 有用的东西:
在 settings.xml 中:
我想最重要的是
块,特别是
设置。I wanted to do the exact same thing today in conjunction with the maven-site-plugin (3.9.1) and was also hitting some roadblocks (specifically, the wagon-ssh plugin insisted on asking me for my Kerberos username and password).
What finally worked for me with wagon-ssh-3.4.3:
and in settings.xml:
I guess what was crucial is the
<configuration>
block and there especially the<preferredAuthentications>
setting.我在这里找到了必要的信息:
http://maven.apache.org/插件/maven-deploy-plugin/examples/deploy-ssh-external.html
I found the necessary info here:
http://maven.apache.org/plugins/maven-deploy-plugin/examples/deploy-ssh-external.html