File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes Ant and CVS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Ant and CVS" Watch "Ant and CVS" New topic
Author

Ant and CVS

M Perfickme
Greenhorn

Joined: Jul 01, 2005
Posts: 3
Hi,

Would some one please help, how do I checkout files from cvs using ant?

Would you please give me step-by-step help to create such a task.

Thank you in advance

N
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42919
    
  68
You don't need to create a new Ant task - Ant has a CVS task built in. It's described in the manual: http://ant.apache.org/manual/index.html.
M Perfickme
Greenhorn

Joined: Jul 01, 2005
Posts: 3
Sorry my mistake. Learn something new every day...

However, still need help.

Am doing:
<target name="checkOut" >
<cvs cvsroot=":blah:blah@blah:blah/blah"
command="checkout"
passfile="C:\...\.cvspass"
dest="c:\..."/>
</target>

And am getting back:
checkout error=2

Thank you in advance

N
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42919
    
  68
Sorry, can't help you there, because I've never used it.
Robb Sherwin
Greenhorn

Joined: Apr 12, 2005
Posts: 3
However, still need help.

Am doing:
<target name="checkOut" >
<cvs cvsroot=":blah:blah@blah:blah/blah"
command="checkout"
passfile="C:\...\.cvspass"
dest="c:\..."/>
</target>

And am getting back:
checkout error=2



I'm getting this in Eclipse as well.

Additionally, when I try to run the exact same build.xml file in a Cygwin window I get an authorization failed error. The exact text is:

authorization failed: server cvs.mycompany.com rejected access to /cvs for user rsherwin


... Has anyone been able to successfully checkout or even perform a diff on code in CVS from the latest version of Ant? I mean, this is the code I'm using in my build.xml file and if it's wrong I'm at a loss to guess what it could be:

Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
from ant manual on cvs task

Found by googling "error=2 ant cvs"

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.


I don't have access to cvs tonight and I usually do cvs diff on the command line or use the compare feature in eclipse, so I don't have any advice on that issue beyond what the cvs task documentation describes.
[ July 20, 2005: Message edited by: Carol Enderlin ]
Robb Sherwin
Greenhorn

Joined: Apr 12, 2005
Posts: 3
Thanks, Carol. I'll check that out in order to get Eclipse integrated correctly.

As an aside, I went into Cygwin to use Ant and CVS that way and eventually learned that the .cvspass file I was using had a newline at the end of it. That screwed up the password descrambling. Once I eliminated it I no longer got any 'authorization failed' messages.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ant and CVS