views:

901

answers:

1

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.

+5  A: 

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-settings>
  <user>[svn user]</user>
  <password>[svn password]</password>
</svn-settings>

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.

Rich Seller
Hi Rich, your suggestion doesn't work (at least for me). Moreover, on your link there is nothing about username and password... So, thereis must be another solution...
MinimeDJ
Check this out: http://stackoverflow.com/questions/3618330/what-is-the-format-of-svn-settings-xml-for-use-with-maven-scm-plugin
MinimeDJ