svn: missing argument: –password

I am currently setting up the Maven Release Plugin for a project which is stored in a SVN repository. The plugin needs to do modifications in the repository, for which it executes a svn command. The credentials it gets from ~/.m2/settings.xml, and the password is passed with the --password parameter. On the command line the password is masked.

Now I ran into the trouble that the svn command fails to execute with the message

svn: missing argument: --password

The complete output is:

[INFO] Executing: /bin/sh -c cd /Users/thoms/Development/projects/fornax/ws/fornax-parent && svn --username kthoms --password '*****' --no-auth-cache --non-interactive status
[INFO] Working directory: /Users/thoms/Development/projects/fornax/ws/fornax-parent
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.031s
[INFO] Finished at: Wed Nov 26 09:39:38 CET 2014
[INFO] Final Memory: 10M/24M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.1:prepare (default-cli) on project fornax-parent: Unable to check for local modifications
[ERROR] Provider message:
[ERROR] The svn command failed.
[ERROR] Command output:
[ERROR] svn: missing argument: --password
[ERROR] Geben Sie »svn help« für weitere Hilfe ein.

I could not explain this, since obviously a svn command was executed with passing my password. So I copied only the svn command and executed this only from command line:

svn --username kthoms --password MYPLAINPASSWORD --no-auth-cache --non-interactive update

Same effect.

Finally I found out that the password itself was causing the problem. Without telling too much I can say it started with the ‘#’ character. This lead to the fact that on shell this was interpreted as a comment. At the end this is completely logical, but I did not think about that scenario when choosing the password. And the error message was a bit misleading here.

Set svn:ignore for multiple files from command line

I just faced faced the problem that I wnated to use the “svn setprop” command on the command line to ignore multiple elements. You could create a file which contains a newline seperated list of files to ignore and pass this file with -F.

svn propset svn:ignore -F ignorelist.txt .

But this requires an additional file. I found the solution in the comments of this article: You could just open quotes and then enter newlines on the command line itself, until the quotes are closed. This means you can use it like this:

svn propset svn:ignore “first
 third” .