通过命令行或提示符传递Maven2中代理服务器的密码?

发布于 2024-09-26 15:52:10 字数 356 浏览 0 评论 0原文

由于我不愿意在 .m2/settings.xml 中以明文形式存储我的用户名和密码(必须使用正常的登录凭据向代理服务器进行身份验证),因此我试图查看是否存在更好的方式来传递我的凭据。

我尝试过的

  • 依赖系统代理设置 - 不起作用(显然)
  • 省略密码 - 下载了 5k - 740b jars。对...
  • -Dmaven.proxy.password=mypass 添加到命令行 - 与上面相同

,我可以通过命令行传递此信息吗?或者更好的是,有没有办法让它提示我输入密码?

仅供参考,当我在配置文件中有密码时,它会按预期工作

As I'm uncomfortable storing my username and password (must auth to the proxy server with my normal login credentials) in plaintext in .m2/settings.xml, I'm trying to see if there is a better way to pass my credentials.

What I've tried

  • Relying on system proxy settings - didn't work (obviously)
  • Leaving out password - downloaded 5k - 740b jars. Right...
  • Adding -Dmaven.proxy.password=mypass to command line - Same as above

is there anyway I can pass this information over command line? Or even better, is there a way to have it prompt me for the password?

FYI, it works as expected when I do have the password in the configuration file

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

失与倦" 2024-10-03 15:52:10

我从未使用过 Maven 的这一特定功能,但它们确实支持在 settings.xml 中加密密码。您可以在这里阅读更多信息: http://maven.apache.org/guides/mini /guide-encryption.html

这并不能完全回答您的问题,但它可能会解决您的根本问题。

I have never used this particular feature of Maven, but they do have some support for encrypting passwords in your settings.xml. You can read more here: http://maven.apache.org/guides/mini/guide-encryption.html

That doesn't exactly answer your question, but it might solve your root problem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文