Specifying SVN user name and password from Ant in IDEA

Apologies if this is super obvious, but I'm trying to create an Ant target that among other things, creates a subversion tag from trunk. Subversion works fine from the IDE itself, I have the Subversion command line components (fron Visual SVN) installed, and I'm able to execute svn staatus in my build script. (Not that the output is super useful, another whole thing...)

When I try to create the desired tag, I get "E730049: Unable to connect to a repository at UR https://myserver/svn/myproject/trunk".

Here's the relevant bit:

<exec executable="svn" resultproperty="svnResult" outputproperty="svnOutput" failonerror="false">
    <arg value="copy" />
    <arg value="${product.svnUrl}/trunk/" />
    <arg value="${product.svnUrl}/tags/${fullVersionString}_TEST" />
    <arg value="-m ${fullVersionString} release tag" />

When I hit that URL in a browser, it asks for credentials, I supply them, and it works fine. However, if I add <arg value="--username foo"  /> and <arg value="--password bar"  /> to the <exec> tag in the build file, I get "invalid option: --username foo".

How can I provide a username and password that will be seen by this command?

A related issue is that I'd rather svn credentials weren't in plain text in the build script. Ideally I'd put them somewhere they'd be honored by the cmd line in this context, but were at least nominally somewhat secure.

It's clearly not using the ones IDEA itself uses, which makes sense,  since it's a spawned cmd process that's running there I think. Is there any way to make that happen?

Seems like both aspects of this might be dealt with by proper setup of the files here:

...but I don't know what to do to get Subversion to store the needed credentials in the proper format.

Thanks all.

1 comment
Comment actions Permalink

Got my build working easily using this: https://github.com/opticyclic/svntask

It does require plain text credentials in the build file, not great, but it's much more idomatic than exec, and working is Good.

Better answers are still welcome.


Please sign in to leave a comment.