简体   繁体   English

如何从pom.xml中的setting.xml文件引用密码

[英]How do I reference a password from the setting.xml file in a pom.xml

I've got a maven project that requires a password to login before performing any actions. 我有一个maven项目,在执行任何操作之前需要密码才能登录。 Maven says that we should maintain passwords in a server stanza in the settings.xml file under the ~/.m2 directory, preferably with the password encrypted. Maven说我们应该在~/.m2目录下的settings.xml文件中的server节中维护密码,最好加密密码。 What the documentation doesn't address is how to reference those passwords, specifically from the pom.xml . 文档没有解决的是如何引用这些密码,特别是从pom.xml引用。 Does anyone know how that can be done? 有谁知道怎么做? If it can't be referenced from the pom is it possible to reference it directly in the code? 如果无法从pom引用它是否可以直接在代码中引用它?

I have the same need. 我有同样的需要。 For me, I wanted to used an encrypted password as a config parameter to a plugin. 对我来说,我想使用加密密码作为插件的配置参数。 I came across a plugin that reportedly supports this: com.github.shyiko.servers-maven-extension. 我遇到了一个据说支持这个的插件:com.github.shyiko.servers-maven-extension。 Caveat: Untested by me as of yet. 警告:我还未经测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM