2

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?

Alexej Magura
  • 4,833
  • 3
  • 26
  • 40
mico
  • 12,730
  • 12
  • 59
  • 99
  • ANT doesn't integrate with pageant... Uncertain how you'd make this work with the CVS task.. The jsch project appears to have recently added support for putty, but this would possibly assist only with the **scp** and **sshexec** ANT tasks.... I wonder if someone has a better idea? – Mark O'Connor Jul 15 '13 at 21:02

1 Answers1

2

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.

Yves Martin
  • 10,217
  • 2
  • 38
  • 77
  • Finally I came back to this issue again in new project and I was able to verify how this solution would work. I used CVS_RSH="C:\path\to\TortoisePlink.exe" and CVSROOT similar to yours and then pageAnt helped me to get through. First ant task run successfully. Thanks! – mico Dec 02 '14 at 09:50
  • I banked my head a lot with the longer version of CVS_RSH, never got that to work. Then I realized I can leave the path only and then pageAnt made the trick. – mico Dec 02 '14 at 09:52