We are using Jenkins and just switched from a file based git repo without authentication to using GitBlit with proper authentication over http.
The problem is - how is maven supposed to authenticate itself in batch mode?
Updating each job with -Dusername
and -Dpassword
(and thus storing the password in the jobs) doesn't seem very feasible. I've read that settings.xml is supposed to work with git by specifying the git server as the id, but whatever I do it has no effect (i.e the release plugin prompts for credentials).
pom.xml:
<properties>
<project.scm.id>git</project.scm.id>
</properties>
<scm>
<connection>scm:git:http://myserver:8081/r/gitauthtest.git</connection>
<developerConnection>scm:git:http://myserver:8081/r/gitauthtest.git</developerConnection>
</scm>
settings.xml contents
<settings>
<servers>
<server>
<id>git</id>
<username>myUser</username>
<password>myPassword</password>
</server>
</servers>
</settings>
Is there any way to get this working? I cannot believe that a task as simple and extremely common as this doesn't have an easy standard solution.