Externalising SCM credentials with Maven

前端 未结 4 1285
名媛妹妹
名媛妹妹 2020-11-30 00:27

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 b

4条回答
  •  佛祖请我去吃肉
    2020-11-30 01:14

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

    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)

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

    
      [svn user]
      [svn password]
    
    

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

    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.

提交回复
热议问题