[ 
http://jira.codehaus.org/browse/MCOBERTURA-65?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=258401#action_258401
 ] 

T G commented on MCOBERTURA-65:
-------------------------------

To anyone who would like to aggregate Cobertura's reports in a multi-module 
Maven project which has a large number of submodules and/or very long pathnames 
for each, then use James's patch given above but add a few lines of code into 
CoberturaReportMojo.java. If it is failing because of these long pathnames, the 
only thing you will notice is that your reports will say all complexities are 0 
when they are not in fact 0. 

What's happening is that it uses cmd.exe to run its commands, and then tries to 
include way too many, huge source files, which goes over the cmd.exe 8191 
character limit, failing the report aggregation with a general exception. 

Here's what you add to CoberturaReportMojo.java to fix it:

In private void executeReport(File curDataFile, File curOutputDirectory, List 
curCompileSourceRoots), add:
 
  CommandLineArguments cmdLineArgs; 
  cmdLineArgs = new CommandLineArguments();
  cmdLineArgs.setUseCommandsFile(true);
  task.setCmdLineArgs(cmdLineArgs);
 
after you set the task defaults and specifics, but before you check the 
formatting. This is enough to change to using the command file to list all of 
the sources which need to be included instead of listing each explicitly on the 
command line. 
 
You also need to add an import statement at the top:
 
  import org.codehaus.mojo.cobertura.tasks.CommandLineArguments;

Rebuild and install the plugin, and this should fix these problems. Hope it 
helps!
 

> Cobertura should aggregate results of multi-module builds
> ---------------------------------------------------------
>
>                 Key: MCOBERTURA-65
>                 URL: http://jira.codehaus.org/browse/MCOBERTURA-65
>             Project: Maven 2.x Cobertura Plugin
>          Issue Type: Improvement
>         Environment: Windows
>            Reporter: David Hoffer
>         Attachments: cobertura_aggregate.diff
>
>
> When I run a cobertura report on parent pom project that has child modules I 
> only get reports generated for each module, I also want to see a combined 
> report in the parent.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to