views:

363

answers:

2

I recently configured Hudson to build a Grails project using Git as the repository. However, I am getting this error when running the build:

Compilation error: srcdir "/home/matthew/.hudson/jobs/qotd-idea/workspace/src/groovy" does not exist

This is because src/groovy is not copied into the Hudson workspace, so Hudson can't find the files. However, this directory is empty anyway. All the valid source files are under the grails-app folder.


On the flip-side, if I specify the project directory as a full path to my source, JUnit tests are not copied over because I am not using the Hudson workspace:

'test/results/TESTS-*.xml' doesn't match anything: even 'test' doesn't exist

How do I get both working together?

+1  A: 

Hudson looks under the workspace directory for the unit test files. But the base directory of

/home/matthew/dev/source/qotd-idea
does not look like a standard Hudson workspace. Have you set the custom workspace feature for this project?

Michael Donohue
Thank you for the insight. I've edited my question to capture the problem more accurately.
Wraith
+1  A: 

To get around the empty folder issue, we normally commit .gitignore to src/grovvy and src/java

I'd recommend doing that instead of pointing Hudson at non-default location.

Have you tried using a full path in the test report location field?

e.g. /home/somedir/qotd-idea/test/results/TESTS-*.xml

cheers

Lee

leebutts
I tried that, but Hudson is still looking for those files. I also tried the full path for the unit tests earlier, but Hudson complained that it didn't match anything and didn't exist.
Wraith
So you tried using .gitignore files in the two folders and it didn't work? If that's the case then something must be wrong with your git setup.
leebutts