Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

how to checkout source from cvs using ant?

Posted on 2006-05-23
37
Medium Priority
?
761 Views
Last Modified: 2012-06-21
how to checkout source from cvs using ant?how to give pass login and pass in build script.
0
Comment
Question by:chaitu chaitu
  • 15
  • 13
  • 5
  • +1
37 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 16741188
Make a file called .cvspass in your home directory. You can then ignore the Ant build file in this respect
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 16741247
how to create  .cvspass in the home directory?

"You can then ignore the Ant build file in this respect"

u mean no need to connect to cvs in ant.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 16741289
>>how to create  .cvspass in the home directory?

What OS?

>>u mean no need to connect to cvs in ant.

No, i mean no need to worry about password
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 20

Author Comment

by:chaitu chaitu
ID: 16741296
XP.
0
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 200 total points
ID: 16741412
Try creating a text file with just the username in it:

notepad "%USERPROFILE%\.cvspass"
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 16741457
"%USERPROFILE%"

what is the meaning of this;

where to put this .cvspass file?
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 16741475
now .cvspass files in my userprofile directory;

how  build.xml will take this .cvspass file;
?

then how to checkout particular source from cvs
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 16741503
>>how  build.xml will take this .cvspass file;

It's actually nothing to do with Ant in a way - it's what cvs itself expects
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 16741624
U didnt understand my problem;my question is i will not go cvs and check particular Release.

i will mention particular Release name in build.xml that should be checked out .
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 16741632
There are examples in the Ant docs:

http://ant.apache.org/manual/CoreTasks/cvs.html
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 16741779
     <property name="cvs.root" value=":pserver:username@xxxx:/xxxx" />
      <property name="cvs.project.name" value="SourceCode/xxx/Release2" />


<cvs cvsRoot="${cvs.root}"
           package="${cvs.project.name}/src"
         
      />

     
     [cvs] Using cvs passfile: C:\Documents and Settings\username\.cvspass

     [cvs] Caught exception: CreateProcess: cvs -d:pserver:username@xxxx:/xxxx checkout "SourceCode/xxx/Release2/src" error=2
0
 
LVL 12

Expert Comment

by:Giant2
ID: 16741827
try:
<property name="cvs.root" value=":pserver:ant:username@xxxx:/xxxx" />

<cvs cvsroot="${cvs.root}" package="${cvs.project.name}/src" passfile=".cvspass" dest="\whereToPutFiles\" />

Hope this could help you.
Bye, Giant.
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 16741893
in the cvspass file;do i put password in cvspass file

:pserver:xxx@xxxo:/xxxx A\*6g4Kw1V



0
 
LVL 86

Expert Comment

by:CEHJ
ID: 16741921
Make sure that package really exists
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 16742086
problem is with password not getting to checkout from cvs;how to set password in cvspass file
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 16742114
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 16742196
i have seen those 2 links before u posted
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 16742214
say if i not login to cvs without giving password;i think we are not gving password in cvspass file;are we?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 16742226
Those tell you what you need to know. If you do all three methods of setting the password, at least one of them should work ;-)
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 16742322
"If you do all three methods of setting the password, at least one of them should work "
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 16742334
Actually i think you should ignore the .cvspass file approach. It is in a special format. Try the other two
0
 
LVL 12

Expert Comment

by:Giant2
ID: 16742404
If you use the .cvspass file approach the file must be like following:

:pserver:THEuserNAME:THEpassWORD@THEhosNAME:/THErootONhost

Bye, Giant.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 16742429
As the link i posted suggests, though, Windows could ignore the .cvspass file. If you want to try that approach anyway, you could maybe check the last access time to see if it's being read
0
 
LVL 6

Expert Comment

by:phuocnh
ID: 16743784

   >  [cvs] Using cvs passfile: C:\Documents and Settings\username\.cvspass

     >[cvs] Caught exception: CreateProcess: cvs -d:pserver:username@xxxx:/xxxx checkout SourceCode/xxx/Release2/src" error=2
Error=2 on WIndows means that you donot have cvs on your path.
Read more
http://ant.apache.org/manual/CoreTasks/cvs.html
and note that
>Important: This task needs "cvs" on the path. If it isn't, you will get an error (such as error 2 on >windows). If <cvs> doesn't work, try to execute cvs.exe from the command line in the target directory >in which you are working.
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 16749712
HOW TO execute cvs.exe from the command line in the target directory in which i am  working?
0
 
LVL 12

Expert Comment

by:Giant2
ID: 16749725
Using Runtime. See here:
http://javaalmanac.com/egs/java.lang/Exec.html?l=rel

Bye, Giant.
0
 
LVL 6

Accepted Solution

by:
phuocnh earned 1600 total points
ID: 16749757
Did you install cvs client in your PC?
If done, you just try to set PATH environment variable to folder containing cvs.exe.
I suppose thet you know how to set an environment variable.
Change directory to the target directory and try command:
cvs -d:pserver:username@<hostaddress>:<path> login
cvs -d:pserver:username@<hostaddress>:<path> co modulename
cvs -d:pserver:username@<hostaddress>:<path> logout
Phuoc H. Nguyen

0
 
LVL 6

Expert Comment

by:phuocnh
ID: 16749779
If you execute cvs.exe from the command line in the target directory successfully, try to use ant again.
Note PATH environment variable should set by "System properties" dialog. If you just use "SET" command, ant can be not see it.
Phuoc H. Nguyen
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 16750059
i went into folder containing cvs.exe;

enter this

cvs -d:pserver:username@<hostaddress>:<path> login

it asked password i entered then i came back to target directory my ant is running and when i type ant still that exception is coming
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 16750068
>>i went into folder containing cvs.exe;

You need to add the bin directory to your path. Simply going into that directory won't help you with Ant
0
 
LVL 12

Assisted Solution

by:Giant2
Giant2 earned 200 total points
ID: 16750137
>Error=2 on WIndows means that you donot have cvs on your path.

>(CEHJ) insert the bin directory of ant in the Path

set path=%PATH%;yourabsolutedirwhereiscvs/bin

or

set the path in the environment variable.

Bye, Giant.
0
 
LVL 6

Expert Comment

by:phuocnh
ID: 16750595
You have set your PATH environment variable?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 16751607
>>set path=%PATH%;yourabsolutedirwhereiscvs/bin

That will only work for that console session
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 16751786
i created one batch file;
set path=c:\ant\bin;
set path=c:\j2sdk1.4.2_06\bin;%path%
set path=C:\Program Files\CVSNT;%path%

in my cvs client there is no bin directory;cvspass file will ignore in windows system;
0
 
LVL 6

Expert Comment

by:phuocnh
ID: 16751861
Yeah, a creative solution.
You are great!
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 16751928
:-)

>>set path=C:\Program Files\CVSNT;%path%

should be

set path="C:\Program Files\CVSNT";%path%
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 16758395
No need to put quotes
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses
Course of the Month14 days, 22 hours left to enroll

577 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question