1

So, I have a Java project for which I have built a (rather complex) ANT build file. Within this file, I have targets to compile, JAR, and test my code, which all work quite well.

What makes this project interesting, is that the team members are working on their personal machines, many of which are running Eclipse Juno on Windows 7. I can not guarantee that any libraries that I add to ANT will be available on the other members' computers. So, i'm trying to reference all the necessary libraries at runtime. However, I am getting an error when I try to get the current revision number.

The error:

svntest:
[echo] Svn4Ant: JWare AntXtras/Svn4Ant 3.0.0, Aug-22-2011, SVNKit: SVN/1.7.8 SVNKit/1.7.8 (http://svnkit.com/) r9538_v20130107_2001
[svn:revget] Unable to execute svnclient subcommand revget. Reason: "svn: E155021: The path {Project Repository} appears to be part of a Subversion 1.7 or greater
[svn:revget] working copy.  Please upgrade your Subversion client to use this
[svn:revget] working copy.".

The ANT Classpath:

AntClassLoader[C:\Users\User\workspace\RoboLib\utils\ant-commons-net.jar;
C:\Users\User\workspace\RoboLib\utils\ant-googlecode-0.0.3.jar;
C:\Users\User\workspace\RoboLib\utils\commons-net-3.2.jar;
C:\Users\User\workspace\RoboLib\utils\jw-antxtras.jar;
C:\Users\User\workspace\RoboLib\utils\jw-svn4ant-admin.jar;
C:\Users\User\workspace\RoboLib\utils\jw-svn4ant.jar; 
C:\Users\User\workspace\RoboLib\utils\svnkit-1.7.8.jar;
C:\Users\User\workspace\RoboLib\utils\svnkit-cli-1.7.8.jar;
C:\Users\User\workspace\RoboLib\utils\svnkit-javahl16-1.7.8.jar]

All of these libraries are at their newest version, and the system they are being tested on is Eclipse Juno running on Windows 7.

The relevant ANT Targets:

<project default="run" name="WAVE RoboLib SDK" basedir="." xmlns:svn="jwaresoftware.svn4ant.client">

... 

<target name="svntest">
    <taskdef uri="jwaresoftware.svn4ant.client"     
    resource="org/jwaresoftware/svn4ant/client/antlib.xml">
        <classpath>
            <fileset dir="utils/">
                <include name="**.jar"/>
            </fileset>
        </classpath>
    </taskdef>

    <svn:libcheck/> 
    <echo message="Svn4Ant: ${svn4ant.label}, SVNKit: ${svnkit.label}"/>

    <svn:server id="my.repo" isdefault="yes" authcache="no" >
        <url value="${svn.url}"/>
        <credential username="un" password="pw"/>
    </svn:server>

    <svn:revget path="." property="build.reporev" />

    <echo message="${build.reporev}" />
</target>
</project>
Peaches491
  • 1,239
  • 15
  • 27

1 Answers1

2

It looks like svn4ant does not support svn 1.7 repositories, see a relevant discussion on this topic with explanation including source code references.

Judging from the svn4ant release plan there is no plan to support svn 1.7 working copies soon. Thus you should look for another way to get the revision information.

One option would be to parse svn info output, use svnversion to get the revision of the working copy or store the revision number somewhere else using a post-commit hook.

harpun
  • 4,022
  • 1
  • 36
  • 40
  • Well that is disappointing. Can you think of any alternative libraries which I can implement in this method? – Peaches491 Jan 28 '13 at 21:13
  • You could try combining the svnkit libraries with a macrodef. See the following answer: http://stackoverflow.com/questions/14259820/problems-getting-my-ant-builds-to-work-after-os-upgrade/14268543#14268543 – Mark O'Connor Jan 28 '13 at 22:02