You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by bkbonner <br...@paraware.com> on 2007/02/23 20:45:47 UTC

Re: [m2] Maven 2 and Cobertura - 100% coverage???

btw, my plugin definition in reporting is:

                         <plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>cobertura-maven-plugin</artifactId>
			</plugin>

Brian
-- 
View this message in context: http://www.nabble.com/Maven-2-and-Cobertura---100--coverage----tf3280827s177.html#a9125462
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: [m2] Maven 2 and Cobertura - 100% coverage???

Posted by bkbonner <br...@paraware.com>.
Thank you all for the suggestions.   I apologize, but I am new to running
cobertura.  I looked at the msgs in the log and they indicated that they
didn't have instrumentation for the classes in question.

[cobertura] INFO  [main] net.sourceforge.cobertura.reporting.html.HTMLReport
- D
ata file does not contain instrumentation information for the file
com/test/model/Piddsdit.java.  Ensure this class was instrumented, an
d this data file contains the instrumentation information.

I've ran 'mvn clean cobertura:instrument' which generated:

C:\Documents and Settings\FUS4076\workspace\pim-biz>mvn clean
cobertura:instrume
nt
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'cobertura'.
[INFO]
-------------------------------------------------------------------------
---
[INFO] Building Business Layer
[INFO]    task-segment: [clean, cobertura:instrument]
[INFO]
-------------------------------------------------------------------------
---
[INFO] [clean:clean]
[INFO] Deleting directory C:\Documents and
Settings\FUS4076\workspace\pim-biz\ta
rget
[INFO] Deleting directory C:\Documents and
Settings\FUS4076\workspace\pim-biz\ta
rget\classes
[INFO] Deleting directory C:\Documents and
Settings\FUS4076\workspace\pim-biz\ta
rget\test-classes
[INFO] [cobertura:clean {execution: default}]
[INFO] [cobertura:instrument]
[WARNING] No files to instrument.
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Fri Feb 23 16:47:36 EST 2007
[INFO] Final Memory: 4M/8M
[INFO]
------------------------------------------------------------------------


My plugin in the build section is:

                        <plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>cobertura-maven-plugin</artifactId>
				<version>2.1-SNAPSHOT</version>
				<configuration>
				  <instrumentation></instrumentation>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>clean</goal>
						</goals>
					</execution>
				</executions>
			</plugin>


And this in the reporting:

			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>cobertura-maven-plugin</artifactId>
				<version>2.1-SNAPSHOT</version>
			</plugin>


Brian

p.s. Wayne, maybe this is a bug, but I wanted to check if someone has it
working successfully.  From the other responses, it sounds like people do
have it working.  Are other people seeing "missed coverages" i.e. red bar in
the cobertura report?




Brad Szabo wrote:
> 
> Since the Cobertura plugin does not properly execute 'clean' by default,
> add the following declaration in <build> to bind its 'clean' goal:
> 
> 
>       <plugin>
>         <groupId>org.codehaus.mojo</groupId>
>         <artifactId>cobertura-maven-plugin</artifactId>
>         <executions>
>           <execution>
>             <goals>
>               <goal>clean</goal>
>             </goals>
>           </execution>
>         </executions>
>       </plugin>
> 
> -Brad
> 
> 
> On Fri, 2007-02-23 at 11:45 -0800, bkbonner wrote:
>> btw, my plugin definition in reporting is:
>> 
>>                          <plugin>
>> 				<groupId>org.codehaus.mojo</groupId>
>> 				<artifactId>cobertura-maven-plugin</artifactId>
>> 			</plugin>
>> 
>> Brian
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Maven-2-and-Cobertura---100--coverage----tf3280827s177.html#a9127537
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: [m2] Maven 2 and Cobertura - 100% coverage???

Posted by Brad Szabo <bs...@unicon.net>.
Since the Cobertura plugin does not properly execute 'clean' by default,
add the following declaration in <build> to bind its 'clean' goal:


      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>clean</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

-Brad


On Fri, 2007-02-23 at 11:45 -0800, bkbonner wrote:
> btw, my plugin definition in reporting is:
> 
>                          <plugin>
> 				<groupId>org.codehaus.mojo</groupId>
> 				<artifactId>cobertura-maven-plugin</artifactId>
> 			</plugin>
> 
> Brian


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


Re: [m2] Maven 2 and Cobertura - 100% coverage???

Posted by Wayne Fay <wa...@gmail.com>.
Sounds like simply a bug in Cobertura. Submit a unit test and someone
will surely take a look at it.

Wayne

On 2/23/07, bkbonner <br...@paraware.com> wrote:
>
> btw, my plugin definition in reporting is:
>
>                          <plugin>
>                                 <groupId>org.codehaus.mojo</groupId>
>                                 <artifactId>cobertura-maven-plugin</artifactId>
>                         </plugin>
>
> Brian
> --
> View this message in context: http://www.nabble.com/Maven-2-and-Cobertura---100--coverage----tf3280827s177.html#a9125462
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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


Re: [m2] Maven 2 and Cobertura - 100% coverage???

Posted by Hilco Wijbenga <hi...@gmail.com>.
On 2/23/07, bkbonner <br...@paraware.com> wrote:
>                          <plugin>
>                                 <groupId>org.codehaus.mojo</groupId>
>                                 <artifactId>cobertura-maven-plugin</artifactId>
>                         </plugin>

"mvn clean" by default doesn't clean the Cobertura generated file.
Unless this has been fixed recently in either Cobertura or Maven,
Cobertura dumps a file in your project directory instead of in the
target directory. You're probably looking at stale data; remove the
Cobertura file and try again.

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