Cobertura report is not getting generated through pom

View: New views
6 Messages — Rating Filter:   Alert me  

Cobertura report is not getting generated through pom

by Ritvik :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
      Can anyone help me ? I have following entries in my pom file.
                                <dependencies>
                                     <dependency>
                                         <groupId>net.sourceforge.cobertura</groupId>
                                         <artifactId>cobertura</artifactId>
                                         <version>1.9</version>
                                    </dependency>
                             </dependencies>
            <build>
                                     <plugins>
                                                     .
                                                     .
                        <plugin>
                                <groupId>org.codehaus.mojo</groupId>
                                <artifactId>cobertura-maven-plugin</artifactId>
                                <configuration>
                                        <check>
                                                <branchRate>85</branchRate>
                                                <lineRate>85</lineRate>
                                                <haltOnFailure>true</haltOnFailure>
                                                <totalBranchRate>85</totalBranchRate>
                                                <totalLineRate>85</totalLineRate>
                                                <packageLineRate>85</packageLineRate>
                                                <packageBranchRate>85</packageBranchRate>
                                                <regexes>
                                                        <regex>
                                                                <pattern>
                                                                        src.main.*
                                                                </pattern>
                                                                <branchRate>90</branchRate>
                                                                <lineRate>80</lineRate>
                                                        </regex>
                                                </regexes>
                                        </check>
                                        <instrumentation>
                                                <includes>
                                                        <include>d.p.*</include>
                                                        <include>d.schemas.*</include>
                                                        <include>d.p.service.impl.*</include>
                                                        <include>d.p.common.util.*</include>
                                                </includes>
                                        </instrumentation>
                                </configuration>
                                <executions>
                                        <execution>
                                                <goals>
                                                        <goal>clean</goal>
                                                        <goal>check</goal>
                                                        <goal>instrument</goal>
                                                        <goal>cobertura</goal>
                                                </goals>
                                        </execution>
                                </executions>
                        </plugin>
                                 </build>
                </plugins>


        <reporting>
                <plugins>
                  <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>cobertura-maven-plugin</artifactId>
                        <version>2.2</version>
                  </plugin>
                </plugins>
        </reporting>


What I am expecting is coetura should generate reports by executing
$ mvn install
command. But folders are getting generated, but it is not generating cobertura.ser and reports.

The output in command prompt is

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building p core
[INFO]    task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] No sources to compile
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Not compiling test sources
[INFO] [surefire:test]
[INFO] No tests to run.
[INFO] [jar:jar]
[INFO] Building jar: E:\WEBLOGIC10-AMT\pCore\target\p-co
re-1.0.jar
[INFO] Preparing cobertura:check
[WARNING] Removing: check from forked lifecycle, to prevent recursive invocation
.
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] No sources to compile
[INFO] [cobertura:instrument]
[WARNING] No files to instrument.
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Not compiling test sources
[INFO] [surefire:test]
[INFO] No tests to run.
[INFO] [cobertura:check {execution: default}]
[INFO] Cannot perform check, instrumentation not performed - skipping.
[INFO] [install:install]
[INFO] Installing E:\WEBLOGIC10-AMT\pCore\target\p-core-
1.0.jar to C:\Documents and Settings\rp91523\.m2\repository\d\p\p-core\1.0\p-core-1.0.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9 seconds
[INFO] Finished at: Thu Aug 27 17:37:33 GMT+05:30 2009
[INFO] Final Memory: 4M/9M
[INFO] ------------------------------------------------------------------------



Thanks in advance....

Re: Cobertura report is not getting generated by pom

by Manfred Moser :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

There seem to be no tests to run....
--
Manfred Moser
http://www.mosabuam.com
skype mosabua, twitter.com/mosabua
http://www.linkedin.com/in/manfredmoser


On Thursday August 27 2009, Ritvik wrote:

> Hi,
>       Can anyone help me ? I have following entry in my pom file.
>                                 <dependencies>
>                                      <dependency>
>
> <groupId>net.sourceforge.cobertura</groupId>
>                                        
> <artifactId>cobertura</artifactId> <version>1.9</version>
> </dependency>
>                              </dependencies>
>             <build>
>                     <plugins>
>                                                      .
>                                                      .
> <plugin>
> <groupId>org.codehaus.mojo</groupId>
> <artifactId>cobertura-maven-plugin</artifactId>
> <configuration>
> <check>
> <branchRate>85</branchRate>
> <lineRate>85</lineRate>
> <haltOnFailure>true</haltOnFailure>
> <totalBranchRate>85</totalBranchRate>
> <totalLineRate>85</totalLineRate>
> <packageLineRate>85</packageLineRate>
> <packageBranchRate>85</packageBranchRate>
> <regexes>
> <regex>
> <pattern>
> src.main.*
> </pattern>
> <branchRate>90</branchRate>
> <lineRate>80</lineRate>
> </regex>
> </regexes>
> </check>
> <instrumentation>
> <includes>
> <include>d.p.*</include>
> <include>d.schemas.*</include>
> <include>d.p.service.impl.*</include>
> <include>d.p.common.util.*</include>
> </includes>
> </instrumentation>
> </configuration>
> <executions>
> <execution>
> <goals>
> <goal>clean</goal>
> <goal>check</goal>
> <goal>instrument</goal>
> <goal>cobertura</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
>                                  </build>
> </plugins>
>
>
> <reporting>
> <plugins>
>  <plugin>
> <groupId>org.codehaus.mojo</groupId>
> <artifactId>cobertura-maven-plugin</artifactId>
> <version>2.2</version>
>  </plugin>
> </plugins>
> </reporting>
>
>
> What I am expecting is coetura should generate reports by executing
> $ mvn install
> command. But folders are getting generated, but it is not
> generating cobertura.ser and reports.
>
> The output in command prompt is
>
> [INFO] Scanning for projects...
> [INFO]
> -------------------------------------------------------------------
>----- [INFO] Building p core
> [INFO]    task-segment: [install]
> [INFO]
> -------------------------------------------------------------------
>----- [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> [INFO] [compiler:compile]
> [INFO] No sources to compile
> [INFO] [resources:testResources]
> [INFO] Using default encoding to copy filtered resources.
> [INFO] [compiler:testCompile]
> [INFO] Not compiling test sources
> [INFO] [surefire:test]
> [INFO] No tests to run.
> [INFO] [jar:jar]
> [INFO] Building jar: E:\WEBLOGIC10-AMT\pCore\target\p-co
> re-1.0.jar
> [INFO] Preparing cobertura:check
> [WARNING] Removing: check from forked lifecycle, to prevent
> recursive invocation
> .
> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> [INFO] [compiler:compile]
> [INFO] No sources to compile
> [INFO] [cobertura:instrument]
> [WARNING] No files to instrument.
> [INFO] [resources:testResources]
> [INFO] Using default encoding to copy filtered resources.
> [INFO] [compiler:testCompile]
> [INFO] Not compiling test sources
> [INFO] [surefire:test]
> [INFO] No tests to run.
> [INFO] [cobertura:check {execution: default}]
> [INFO] Cannot perform check, instrumentation not performed -
> skipping. [INFO] [install:install]
> [INFO] Installing E:\WEBLOGIC10-AMT\pCore\target\p-core-
> 1.0.jar to C:\Documents and
> Settings\rp91523\.m2\repository\d\p\p-core\1.0\p-core-1.0.jar
> [INFO]
> -------------------------------------------------------------------
>----- [INFO] BUILD SUCCESSFUL
> [INFO]
> -------------------------------------------------------------------
>----- [INFO] Total time: 9 seconds
> [INFO] Finished at: Thu Aug 27 17:37:33 GMT+05:30 2009
> [INFO] Final Memory: 4M/9M
> [INFO]
> -------------------------------------------------------------------
>-----
>
>
>
> Thanks in advance....


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

    http://xircles.codehaus.org/manage_email



Re: Cobertura report is not getting generated by pom

by Ritvik () :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Moser,
            Tnx for your quick reply. Here is a maven directory structure.

|src
     |test
           |java
                  |d.p.services.TestClasses

     |main
            |d.p.services.Classes


As per standard I have put all test cases in test directory of src at the same level of main classes.

Re: Cobertura report is not getting generated by pom

by Manfred Moser :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thursday August 27 2009, Ritvik wrote:

> Hi Moser,
>             Tnx for your quick reply. Here is a maven directory
> structure.
>
> |src
> |
>      |test
>      |
>            |java
>            |
>                   |d.p.services.TestClasses
>      |
>      |main
>      |
>             |d.p.services.TestClasses
>
> As per standard I have put all test cases in test directory of src
> at the same level of main classes.

Sure.. but looking at your log output it says no tests to run...

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

    http://xircles.codehaus.org/manage_email



Re: Cobertura report is not getting generated by pom

by Ritvik :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey do I need any additional entry in my pom file to execute tests.
Right now I have commented out surefire report tag. But the dependency for Junit is defined.
Does the cobertura report needs tests to run every time ?
I am new to cobertura ...

Re: Cobertura report is not getting generated by pom

by Manfred Moser :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sunday August 30 2009, Ritvik wrote:
> Hey do I need any additional entry in my pom file to execute tests.
> Right now I have commented out surefire report tag. But the
> dependency for Junit is defined.
> Does the cobertura report needs tests to run every time ?
> I am new to cobertura ...

AFAIK cobertura runs the tests again via surefire with instrumented
classes. So if no tests are there to run.. cobertura will not have any
data to look at.

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

    http://xircles.codehaus.org/manage_email