使用Maven外部化SCM凭证 [英] Externalising SCM credentials with Maven

查看:101
本文介绍了使用Maven外部化SCM凭证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种方法可以将我的SCM凭据外部化,以便不将其存储在项目的POM中?问题在于,如果它们包含在项目的POM中,则在部署项目时所有用户都可以看到它们.

Is there a method to externalize my SCM credentials so they are not stored in the project's POM? The problem being if they're contained in the project's POM, they will be visible to all when the project is deployed.

推荐答案

对于许多SCM提供程序都可以做到这一点,我认为Subversion是基于您的标记的实现.

This can be done for many of the SCM providers, I assume Subversion as the implementation based on your tag.

您可以在$ user.home/.scm/svn-settings.xml(或[maven home]/conf/.scm/svn-settings.xml)中定义Subversion设置,尽管这意味着它们仍然可见给系统用户)

You can define your Subversion settings in $user.home/.scm/svn-settings.xml (or [maven home]/conf/.scm/svn-settings.xml, though this means they'll still be visible to users of the system)

在该文件中,您可以设置Subversion服务器的用户名和密码.文件内容应如下所示:

In that file you can set your username and password for the Subversion server. The file contents should look like this:

<svn-settings>
  <user>[svn user]</user>
  <password>[svn password]</password>
</svn-settings>

您可以在该配置文件中定义其他一些属性.有关更多详细信息,请参见 Subversion SCM页面的提供商配置"部分.

You can define some other properties in that configuration file. For more details see the "Provider Configuration" section of Subversion SCM page.

其他SCM提供程序也有类似的方法,例如,在CVS中,设置存储在同一位置(.scm文件夹)的cvs-settings.xml中,请参见

Other SCM providers have a similar approach, for example in CVS the settings are stored in cvs-settings.xml in the same location (the .scm folder), see the CVS SCM page for details.

这篇关于使用Maven外部化SCM凭证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆