Question

I have ant build file, that should take cvs checkouts when called. I can call it ok, but when ant uses cvs to connect to cvs repo, the repo prompts for password and obviously ant command fails.

I have CVSROOT environment variable pointing to same location where I took the initial checkout for the project with TortoiseCVS, having ssh as protocol.

I also have putty's pageant running and an environment variable CVS_RSH pointing to plink.exe of putty. That combination should make the connection via putty, 'cause from pageAnt menu the connection opens without prompts.

My operation system is Windows 8.

Question here is, that why ant build fails on cvs server password prompt, although PageAnt otherwise is enabling promptless access via ssh+cvs?

Was it helpful?

Solution

Ant cvs task invokes cvs.exe command line from PATH so if everything works properly from command line, there is (almost) no reason it will fail from Ant.

Here is a checklist with points to verify:

  • CVSROOT must contain username and specify ext protocol, :ext:username@cvserver.domain.ldt:/path/to/repository
  • CVS_RSH must point to plink.exe with absolute file path and you have to ensure it will use SSH protocol
  • Your SSH private key must have been loaded into Pageant for the same user session as the user running Ant script

If it does not help, please provide more details about your cvs task options and your workstation setup.

When running without any user session opened and Pageant cannot help, often for continuous integration tools, a better option is to pass all arguments like username and private key file to plink directly in CVS_RSH variable:

CVS_RSH="C:\path\to\plink.exe -batch -ssh -l username -i C:\path\user\ssh-privatekey.ppk"

Of course, in such a case, your private key file must not be protected with a passphrase.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top