Solution to ‘svn: authorization failed: Could not authenticate to server: rejected Basic challenge’ error

Posted on: Tuesday, Oct 25, 2011

Here’s a post of something that I wanted to make a note of and may be useful to keep.

I got an error when trying to do a Maven release. I was using the command:

mvn release:prepare

and getting the following:

[ERROR] Provider message:
[ERROR] The svn tag command failed.
[ERROR] Command output:
[ERROR] svn: OPTIONS of 'http://extranet.esperantoxl.nl/subversion/': authorization failed: Could not authenticate to server: rejected Basic challenge (http://extranet.esperantoxl.nl)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

I’m not sure where my authentication details were getting lost, but as a workaround, I added the authentication on the command line:

mvn release:prepare -Dusername=[username] -Dpassword=[password]