[ 
http://jira.codehaus.org/browse/MCOBERTURA-42?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benson Margulies closed MCOBERTURA-42.
--------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.5

As of MCOBERTURA-85 and 2.5, there is aggregation support. So suppressing the 
entire plugin for pom packaging doesn't make sense.

> [cobertura] plugin should handle projects with no source code
> -------------------------------------------------------------
>
>                 Key: MCOBERTURA-42
>                 URL: http://jira.codehaus.org/browse/MCOBERTURA-42
>             Project: Maven 2.x Cobertura Plugin
>          Issue Type: Bug
>         Environment: Maven 2.0.4
> cobertura-maven-plugin 2.0
>            Reporter: Jimisola Laursen
>            Assignee: Benson Margulies
>             Fix For: 2.5
>
>
> The Cobertura Maven  Plugin fails when it can't find a cobertura.ser file 
> (see end).
> However, not all Maven projects have source code. E.g. a top level pom (i.e. 
> packaging = pom) doesn't.
> We have all our sub projects use cobertura and we therefore have cobertura 
> configured in the top level pom which eases everything a lot.
> The plugin should simple ignore to run when the current project has pom 
> packaging.
> I've mentioned to the Maven Team that this is a general problem with many 
> plugins and that it therefore should be a general solution for this,
> but so far they feel that it is up to each  individual plugin since e.g. 
> surefire-plugin doesn't fail if there are no test classes.
> Anyway, it a small fix:
> 1) add new property executeOnPackaging
>     /**
>      * Configures for packaging types this plugin should be executed
>      * @parameter property="executeOnPackaging"
>      * @require
>      */
>     private String executeOnPackaging[] = new String[] {"jar", "war", "ear"};
> 2) add check to execute method
>     public void execute() throws MojoExecutionException, MojoFailureException
>     {
>         // IMPORTANT: must sort - otherwise binarySearch won't work
>         Arrays.sort(this.executeOnPackaging);
>         
>         if (Arrays.binarySearch(this.executeOnPackaging, 
> this.project.getPackaging()) < 0)
>         {
>             this.getLog().info("Cobertura plugin not run since project 
> packaging " +  this.project.getPackaging() + " is not one of  " + 
> this.executeOnPackaging);
>             
>             return;
>         }
>         [...]
> ------------------------------------------------------------------
> [ERROR] Error: data file 
> /home/jimisola/p4clients/lt/iso/main/product/cobertura.ser does not exist
> [INFO] 
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Error during page generation
> Embedded error: Error rendering Maven report: Error in Cobertura Report 
> generation: Unable to generate Cobertura Report for project.

-- 
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