tags:

views:

634

answers:

2

I am setting up a new Hudson task (on WinXP) for a project which generates javascript files, and performs xslt transformations as part of the build process.

The ant build is failing on the XSL transformations when run from Hudson, but works fine when the same build on the same codebase (ie in Hudson's workspace) is run from the command line.

The failure message is:

line 208: Variable 'screen' is multiply defined in the same scope.

I have tried configuring Hudson to use both ant directly and to use a batch script - both fail in Hudson.

I have tried in Firefox, IE6 and Chrome and have seen the same issue.

Can anyone suggest how we can workaround this problem with Hudson?

A: 

I would assume this is not an issue with Hudson directly, as it is with the build script and/or the environment itself.

Is your build script relying on certain environment variables being defined, or worse, the job running from within a certain directory structure (i.e. it works if it's run from under /home/mash/blah but not from under another directory like /tmp)? Is the build script making reference to external files by relative paths?

These are the things I would look into. For environment variables, you can tell Hudson to pass these into Ant. For the other issues, you probably want to change your build script. Check the console output provided by Hudson, and maybe set Ant to print verbose/debug messages to get a better idea about the environment/filepaths.

matt b
+1  A: 

Problem solved.

Our build is actually dependent on jdk 1.4.2, and Hudson appears to run using 1.6. When I set Hudson to run as a service, it ran as my local user, which meant that it picked up the 1.4.2 JAVA_HOME environment variable - and therefore worked.

I guess another possible solution is to configure Hudson to use 1.4.2 by default.

Matthew Hegarty

related questions