*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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
Author

Steps to check out from svn by ANT script:

mehul thakor
Greenhorn

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 http://subclipse.tigris.org
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="svntask.properties" 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 : http://www.sliksvn.com/en/download/
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 build.properties 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="build.properties" />
<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" />
</path>

<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}" />
</svn>
</target>
</project>

Sample of build.properties:

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

svnant.version=0.6.0

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

jsvn.jar=jsvn.jar
svnant.jar=svnant.jar
svnClientAdapter.jar=svnClientAdapter.jar

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
Bartender

Joined: Dec 20, 2006
Posts: 2491
    
    8

What is your question?


OCUP UML fundamental and ITIL foundation
youtube channel
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Steps to check out from svn by ANT script:
 
Similar Threads
svn update using ant
svn list command does not work
Error - "Cannot use javahl nor command line svn client" with subversion
org/tigris/subversion/svnant/SvnTask (Unsupported major.minor version 49.0)
svnant checkout doesnt work