You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by D D <c_...@yahoo.fr> on 2006/05/24 15:36:39 UTC

Cobertura reports 0% for some classes

Hi,

I am using the cobertura plugin, with the configuration set as documented. But the report shows that some classes that should have been covered have a 0% rate (the others are fine). I cannot see any connection between those classes that are not covered. I saw in the traces that these classes seems to have been correctly instrumented. Sometimes it raises warnings saying that it cannot find source code for some classes. I have tried to clean before, but it does not change anything.

Any help appreciated, thanks

David DIDIER


Re: Cobertura reports 0% for some classes

Posted by Roy van der Kuil <ro...@gmail.com>.
I had the same problem for projects that I have 'moved' from ant to maven
(2). The test sources where in the same src directory as the main sources (I
only had one src path). After creating 2 source trees (according to mavens
best practice) it works like a charm.

Re: Cobertura reports 0% for some classes

Posted by achapman <an...@ons.gsi.gov.uk>.
I managed to fix it by specifying the latest version of surefire - 2.2. It
looks like the default version that maven 2.0.4 uses is 2.0 which does not
support the forkMode setting. According to comments in the
maven-cobetura-plugin SVN the cause of this problem is that the
cobertura.ser file is not closed until the JVM exits. With forkMode set to
once or pertest the cobertura.ser file is closed before the report is
generated.

Andy
-- 
View this message in context: http://www.nabble.com/Cobertura-reports-0--for-some-classes-tf1675082.html#a5359995
Sent from the Maven - Users forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Cobertura reports 0% for some classes

Posted by achapman <an...@ons.gsi.gov.uk>.
Curiously I'm getting the same problem but in reverse. If I delete
cobertura.ser I get 0% coverage for everything. If not deleted then the
reports show the results of the previous build - i.e. I could increase
coverage, build, and see no change in the coverage report; build again and
increased coverage is reported.

Any ideas greatly appreciated.

Andy
-- 
View this message in context: http://www.nabble.com/Cobertura-reports-0--for-some-classes-tf1675082.html#a5328129
Sent from the Maven - Users forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Cobertura reports 0% for some classes

Posted by Allan Ramirez <ar...@exist.com>.
You can also execute the clean in the command prompt with "mvn clean 
cobertura:clean cobertura:cobertura"

-allan

Jason Chaffee wrote:

>You can add the clean execution to the cobetura plugin executions to
>delete the .ser file during mvn clean.
>
>          <execution>
>            <id>clean</id>
>            <goals>
>              <goal>clean</goal>
>            </goals>
>          </execution>
>
>-----Original Message-----
>From: Jamie Bisotti [mailto:jbisotti@gmail.com] 
>Sent: Wednesday, May 24, 2006 8:39 AM
>To: Maven Users List; D D
>Subject: Re: Cobertura reports 0% for some classes
>
>On 5/24/06, D D <c_...@yahoo.fr> wrote:
>  
>
>>Hi,
>>
>>I am using the cobertura plugin, with the configuration set as
>>    
>>
>documented.
>  
>
>>But the report shows that some classes that should have been covered
>>    
>>
>have a
>  
>
>>0% rate (the others are fine). I cannot see any connection between
>>    
>>
>those
>  
>
>>classes that are not covered. I saw in the traces that these classes
>>    
>>
>seems
>  
>
>>to have been correctly instrumented. Sometimes it raises warnings
>>    
>>
>saying
>  
>
>>that it cannot find source code for some classes. I have tried to
>>    
>>
>clean
>  
>
>>before, but it does not change anything.
>>
>>Any help appreciated, thanks
>>
>>David DIDIER
>>
>>
>>
>>    
>>
>I've seen this before too.  Seems to be a Cobertura bug relating to the
>file
>it creates in your project root directory (I forget what it is named,
>cobertura.ser?).  If I delete that before running Cobertura, the numbers
>seem to be accurate.
>
>HTH,
>
>  
>


RE: Cobertura reports 0% for some classes

Posted by Jason Chaffee <ja...@tvworks.com>.
You can add the clean execution to the cobetura plugin executions to
delete the .ser file during mvn clean.

          <execution>
            <id>clean</id>
            <goals>
              <goal>clean</goal>
            </goals>
          </execution>

-----Original Message-----
From: Jamie Bisotti [mailto:jbisotti@gmail.com] 
Sent: Wednesday, May 24, 2006 8:39 AM
To: Maven Users List; D D
Subject: Re: Cobertura reports 0% for some classes

On 5/24/06, D D <c_...@yahoo.fr> wrote:
>
> Hi,
>
> I am using the cobertura plugin, with the configuration set as
documented.
> But the report shows that some classes that should have been covered
have a
> 0% rate (the others are fine). I cannot see any connection between
those
> classes that are not covered. I saw in the traces that these classes
seems
> to have been correctly instrumented. Sometimes it raises warnings
saying
> that it cannot find source code for some classes. I have tried to
clean
> before, but it does not change anything.
>
> Any help appreciated, thanks
>
> David DIDIER
>
>
>
I've seen this before too.  Seems to be a Cobertura bug relating to the
file
it creates in your project root directory (I forget what it is named,
cobertura.ser?).  If I delete that before running Cobertura, the numbers
seem to be accurate.

HTH,

-- 
Jamie Bisotti

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Cobertura reports 0% for some classes

Posted by Jamie Bisotti <jb...@gmail.com>.
On 5/24/06, D D <c_...@yahoo.fr> wrote:
>
> Hi,
>
> I am using the cobertura plugin, with the configuration set as documented.
> But the report shows that some classes that should have been covered have a
> 0% rate (the others are fine). I cannot see any connection between those
> classes that are not covered. I saw in the traces that these classes seems
> to have been correctly instrumented. Sometimes it raises warnings saying
> that it cannot find source code for some classes. I have tried to clean
> before, but it does not change anything.
>
> Any help appreciated, thanks
>
> David DIDIER
>
>
>
I've seen this before too.  Seems to be a Cobertura bug relating to the file
it creates in your project root directory (I forget what it is named,
cobertura.ser?).  If I delete that before running Cobertura, the numbers
seem to be accurate.

HTH,

-- 
Jamie Bisotti