0

I have an ant build.xml file with the following setup:

<typedef resource="org/tigris/subversion/svnant/svnantlib.xml"
 classpathref="svnant.classpath"/>

<svnSetting id="svn.settings" username="${svn.username}" password="${svn.pw}" 
javahl="false" svnkit="true" failonerror="true"/>

<target name="commit">
   <svn refid="svn.settings">
        <commit file="${webcontent}/version.properties"
            message="commit version from build.xml by ${user.name}"
        />
    </svn>

</target>

Running the ant build generates the following output:

[svn] Using svnkit
[svn] <Commit> started ...
[svn] commit -m "commit version from build.xml by username" -N C:/path/to/WebContent/version.properties

But it never finishes. Just hangs on that statement. I end up having to terminate the build and cleaning up the svn directory since the WebContent directory was set to locked by SvnKit

The client repository is svn version 1.6 and I'm using svnant version 1.3.1 Ant version is 1.7.1

What's the deal with this?

Why does it never toss an error or stop?

Is SvnKit only SVN version 1.7+?

EDIT:

So I messed around with it a little more. If I run the build and the file doesn't have any changes, the build continues with

 [svn] <Commit> finished.

But if I make any edits to the file and run the build it hangs.

What am I missing?

pclem12
  • 449
  • 10
  • 23
  • I recommend running your Ant build in a debugger. See [Is it possible to debug an external ant task?](http://stackoverflow.com/questions/11358848/is-it-possible-to-debug-an-external-ant-task/11363385#11363385) for an example. When you think that the build has hung, use your debugger's Break command. This will give you a call stack. Copy the call stack and add it to your original post and we may be able to glean more insight. – Chad Nouis Apr 02 '13 at 22:17
  • Thanks @ChadNouis, I finally found out that I was setting my svn user name and pw before the properties file for them was loaded. It was hanging because the repository requires a username/pw but none were supplied. Seems like something that either the server would reject or the client would realize is incorrect though. – pclem12 Apr 03 '13 at 01:41
  • @pclem12 Can you post your comment as an anwser so every one will easily see that this question has been resovled? – Marc-Andre Apr 05 '13 at 15:53

1 Answers1

1

Thanks @ChadNouis, I finally found out that I was setting my svn user name and pw before the properties file for them was loaded.

It was hanging because the repository requires a username/pw but none were supplied.

Seems like something that either the server would reject or the client would realize has timed out, but that was the issue.

The offending configuration:

<typedef resource="org/tigris/subversion/svnant/svnantlib.xml"
 classpathref="svnant.classpath"/>

<!-- create svnSetting from properties...that don't exist yet -->
<svnSetting id="svn.settings" username="${svn.username}" password="${svn.pw}" 
javahl="false" svnkit="true" failonerror="true"/>

<!-- properties file loaded after svnSetting created...d'oh -->
<property file="svn-credentials.properties"/>

<target name="commit">
   <svn refid="svn.settings">
        <commit file="${webcontent}/version.properties"
            message="commit version from build.xml by ${user.name}"
        />
    </svn>

</target>
pclem12
  • 449
  • 10
  • 23
  • Can you share a bit of your modified code here with us. I'm having a similar problem and I'm not sure what properties file you're talking about. – kminke Nov 23 '15 at 14:13
  • @kminke see my edits to the answer. Hope that helps. – pclem12 Nov 23 '15 at 21:47