title: How to put maven settings.xml with password in source control
body: <p>I'm building a docker image for a jenkins slave. That jenkins slave will have to push and pull artifacts to/from an artifacts repository.</p>
  
  <p>This is for Java and maven projects. So I need to have in my docker container a settings.xml so that I can authenticate in several private repositories.</p>
  
  <p>My idea would be to copy a settings.xml in the Dockerfile, but because it has sensitive information (username, password), I'm concerned about security. Can I encrypt this content in the source control? And more important, can I avoid people from just downloading this file and being able to use the encrypted credentials? Ideally I should have a mechanism to make sure the encrypted file only works in the context of the docker container.</p>