I was having a problem with the cobertura plugin in Hudson so I did some digging
through the code. I found that when using CVS the search path is relative to the
first module. Issue 916 discusses this, but it looks like the implemented hack
only supports subversion and not CVS:
197 if (project.getScm() instanceof SubversionSCM) {
198 // hack of the first kind
199 SubversionSCM scm = SubversionSCM.class.cast(project.getScm());
200 multipleModuleRoots = scm.getLocations().length > 1;
201 } else {
202 multipleModuleRoots = false;
203 }
I could work around this if the includes supported '..', but as issue 916 points
out, that doesn't work either. So I've worked around it by copying the
coverage.xml file to the first module in my Job config, but others may have the
same problem.
The SCM interface now supports getting the root module, but that returns the
first module in the CVS implementation. The documentation on the Cobertura
plugin describes how SVN works with multiple modules, but it isn't clear about
CVS (which also supports multiple modules).
Maybe the right solution would be to apply the search path to each module
defined in order until a match is found or if there are multiple modules
(regardless of the SCM used), switch to using the workspace as the root.
I'll work on this issue. It makes sense that the behavior should be consistent across all SCMs that support
multiple modules, rather than treating Subversion differently. Thus, I'm planning on making it such that if
the SCM says that there are multiple module roots, the default base directory will be the workspace.
Also, note that there is now an enhancement ticket (3862) for the ability to configure where the base
directory should be, to support cases where the default value isn't what the user needs.