File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Blatant Advertising and the fly likes Steps to check out from svn by ANT script: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Other » Blatant Advertising
Bookmark "Steps to check out from svn by ANT script:" Watch "Steps to check out from svn by ANT script:" New topic

Steps to check out from svn by ANT script:

mehul thakor

Joined: Oct 23, 2008
Posts: 5
Steps to check out from svn by ANT script:

1] SvnAnt
You can find latest version of svnant on
2] extract the zip and get the jar file from lib folder
3] Put the svnant.jar and svnClientAdapter.jar files to classpath of your ant build file.
(Or directly to your ANT_HOME/lib directory.)
4] In the build file, load the <svn> task.
E.g. like this:
<taskdef resource="" classpathref="project.classpath"/>
(where svnant.jar lies in the "project.classpath")

5] To provide access to the Subversion API, svnant uses svnClientAdapter on top of
either the JavaHL native Subversion Java (JNI) bindings or Subverion's
command line programs (which must be installed and in your PATH).

FOR Subversioning ,SVN needs to be recognized by your system.
Get COMMAND LINE PROGRAM for this recognition.
Most preferable is SLIK Subversion for 32 -bit
Link is :
6] After installing restart the computer
7] now go to command prompt and write
Svn �version
It will get recognized�.as follows:
Type svn_help for more

8] Write the build.xml and to check out the file from SVN and place them under your WORK_DIR.

Sample of build.xml:

<?xml version="1.0"?>

<project name="svn-test" basedir="." default="checkoutThis">

<property file="" />
<path id="project.classpath">
<pathelement location="jsvn.jar" />
<pathelement location="svnant.jar" />
<pathelement location="svnClientAdapter.jar" />
<pathelement location="commons-lang-2.0.jar" />
<pathelement location="jakarta-regexp-1.3.jar" />
<pathelement location="svnjavahl.jar" />

<taskdef name="svn" classname="org.tigris.subversion.svnant.SvnTask" classpathref="project.classpath"/>

<target name="checkoutThis">

<svn username="${svnant.repository.user}" password="${svnant.repository.passwd}">
<checkout url="${svnant.this.url}" revision="HEAD" destPath="${svnant.latest.url}" />

Sample of

# -----------------------------------------------------------------------------
# This file is referenced by the build.xml file.
# $Id$
# -----------------------------------------------------------------------------


# -----------------------------------------------------------------------------
# all jar needed
# -----------------------------------------------------------------------------


svnant.latest.url=�Desination directory�
svnant.this.url=�SVN URL from where to checkout file�
svnant.repository.user=�Username for SVN athentication�
svnant.repository.passwd="password for SVN athentication"

9To checkout file, open command prompt and cd to WORK_DIR.

1.Execute ant.

2.If the build is successful, the following message will appear. Your files have been successfully checkout to the desination path.

3]if your file name is other then build.xml
Then write command as follows:

Ant �f file_name.xml
Jan Cumps

Joined: Dec 20, 2006
Posts: 2565

What is your question?

OCUP UML fundamental and ITIL foundation
Peter Johnson

Joined: May 14, 2008
Posts: 5852

Mehul, welcome to JavaRanch!

I should point out that the forums are used for asking questions about Java technologies. They are not intended to be blogs where you post tutorials on how to do various things. I do encourage you, however, to either post your own questions or post answers to other's questions.

Also, when making a lengthy post, please take the time to format it properly so that it is easy to read and understand. Use the 'code' UBBCode tag to format any source code, especially XML. You can edit your post to fix the formatting by clicking on the paper-and-pencil icon.

JBoss In Action
I agree. Here's the link:
subject: Steps to check out from svn by ANT script:
It's not a secret anymore!