Pragmatic Programmer Stuart Holloway said in a tweet recently, “Anybody can be agile in a green field. Show me your 3rd, 4th, and 5th releases.” Well, we've been maintaining Oracle Mojarra JSF for 32 releases and, we’ve found hudson a completely invaluable tool for maintaining agility as the technology matures and requires maintenance across all the versions we've ever released. Unfortunately, project hygiene has been difficult to maintain across all the code lines, and the JSF 1.2 branch hasn't had a working hudson job in several years. This blog entry shares a little tip I uncovered while re-activing the Mojarra JSF 1.2 job.

Mojarra JSF 1.2 is maintained in CVS because it is not economically viable to move it to a more recent version control system. As such, it must use CVS_RSH. More recent versions of hudson have support for this, but for some reason I haven't been able to get it working with the cvs server. I used a combination of perl and expect to get the checkout working.

I had to download and install expectperl from <> and the IO::Tty perl module from <> This little perl script successfully does the cvs update, even with the ssh password prompting.

  1. #!/usr/bin/perl
  3. use Expect;
  5. chdir("/files/hudson_local/jobs/MOJARRA_1_2X_ROLLING_GLASSFISH_2_1_1/workspace");
  6. $ENV{"CVSROOT"} = "";
  8. ($cvs = Expect->spawn("cvs update -d -P")) || die "Couldn't spawn cvs, $!";
  10. unless ($cvs->expect(30, "Enter passphrase for key '/files/hudson_local/.ssh/id_rsa':")) {
  11.   die "Never got the passphrase prompt";
  12. }
  14. print $cvs "this is not the real password\r";
  16. unless ($cvs->expect(300, "cvs update: Updating www/legal/jsf-cddl")) {
  17.   die "Never saw update starting";
  18. }