通过命令行或提示符传递Maven2中代理服务器的密码?
由于我不愿意在 .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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我从未使用过 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.