Hi All,

I am beginning now to migrate many of our projects to maven 2, but I am not permitted to move the location of the stuff in the src directory as CVS is unable to retain the history in this case and we have no plans to move to something more useful such as subversion.

the directory structure we have is

pom.xml
src/
- org/
-- epo/
--  etc
- site/
-- apt/
--- index.apt
-- fml/
--- faq.fml
-- site.xml
-test/
-- java/
--- org/
---- epo/
----- etc

i tried setting my <sourceDirectory> to src/ but the compiler then tries to build everything in the test directory as well.

so i tell maven2 to exclude src/test and src/site from the main compile goal

<excludes>
  <exclude>**/test/**</exclude>
  <exclude>**/site/**</exclude>
</excludes>
into my parent pom's compiler config,

and that works fine, but now cobertura is not instrumenting any of my classes (or indeed even being invoked as far as i can tell)
running mvn site however pretends to generate a cobertura report but it just ends up being blank - this is a showstopper for me.
cobertura generates the following error: net.sourceforge.cobertura.reporting.ComplexityCalculator - cannot find source file during CNN computation ...
so clearly cobertura is not finding the source files. (i have added a comment to this effect to http://jira.codehaus.org/browse/MCOBERTURA-2)

the following problems are annoying but i have live with them for now:
also the javadocs are being generated for the test classes.  there is no <excludes> config for the javadoc tool according to the documentation. i tried adding an excludes config as per the compiler plugin but, while it threw no error, neither did it actually have any effect.
checkstyle's excludes config param uses a different syntax to the compiler's excludes syntax and the format is not documented.  is it a comma separated list of paths? either way i tried adding <excludes>**/test/**</excludes> but that made no difference at all.
pmd reports fail as they are looking for the src in src/main/java and ignoring the sourceDirectory (but PMD is being a pain anyway so i am not so concerned with this at the moment)

it seems to me that the <sourceDirectory> tag could do with having some in-build excludes and includes sub-tags

Kind regards,
Dave Sag




 

Reply via email to