Integrating jenkins with cobertura

388 views
Skip to first unread message

rahulshar...@gmail.com

unread,
Mar 31, 2016, 6:19:16 AM3/31/16
to Jenkins Developers
Hi,
I am trying to integrate jenkins with cobertura  so that I can get the code coverage. but I am getting errors. I  am unable to create coverage.xml file.
I am getting the following errors;
 
[Cobertura] No coverage results were found using the pattern '' relative to 'C:\Jenkins\workspace\COB-AutomatedTesting'.  Did you enter a pattern relative to the correct directory?  Did you generate the XML report(s) for Cobertura?
Build step 'Publish Cobertura Coverage Report' changed build result to FAILURE
Finished: FAILURE
 
I am also including my pom.xml file. Please tell whether it is correct or some modifications are required.
 
 
 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.selcukesfw1</groupId>
  <artifactId>SelCukesFW1</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <dependencies>
   <dependency>
    <groupId>info.cukes</groupId>
    <artifactId>cucumber-junit</artifactId>
    <version>1.1.6</version>
   </dependency>
   <dependency>
    <groupId>info.cukes</groupId>
    <artifactId>cucumber-java</artifactId>
    <version>1.1.6</version>
   </dependency>
   <dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>2.41.0</version>
   </dependency>
   <dependency>
    <groupId>commons-configuration</groupId>
    <artifactId>commons-configuration</artifactId>
    <version>1.10</version>
   </dependency>
   <dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.11</version>
   </dependency>
   <dependency>
    <groupId>commons-dbutils</groupId>
    <artifactId>commons-dbutils</artifactId>
    <version>1.5</version>
   </dependency>
   <dependency>
    <groupId>info.cukes</groupId>
    <artifactId>cucumber-core</artifactId>
    <version>1.1.7</version>
   </dependency>
   <dependency>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpclient</artifactId>
    <version>4.3.3</version>
   </dependency>
   <dependency>
    <groupId>net.sourceforge.htmlunit</groupId>
    <artifactId>htmlunit</artifactId>
    <version>2.15</version>
   </dependency>
     <dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>5.1.35</version>
   </dependency>
  </dependencies>
     
      <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-report-plugin</artifactId>
        <version>2.19</version>
      </plugin>
      <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>cobertura-maven-plugin</artifactId>
      <version>2.2</version>
      <configuration>
        <formats>
          <format>html</format>
        <format>xml</format>
        </formats>
      </configuration>
    </plugin>
    </plugins>
  </reporting>
 
  
    <build>
    <finalName>ideagen</finalName>
    <plugins>
       <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-compiler-plugin</artifactId>
           <version>2.3.1</version>
           <configuration>
               <source>1.7</source>
               <target>1.7</target>
           </configuration>
       </plugin>
       <plugin>
        <groupId>org.codehaus.mojo</groupId>
      <artifactId>cobertura-maven-plugin</artifactId>
      <version>2.2</version>
      </plugin>
    </plugins>
  </build>
</project>

Vivekanand S V

unread,
Mar 31, 2016, 7:54:15 AM3/31/16
to Jenkins Developers
Considering that coverage.xml is not generated from your message above, you are looking at the wrong trace. You need to check the error while generating the coverage report.

In case the file is generated, the pattern in empty in the error message so nothing will match anyway. What is the output file name you are generating ? If it is coverage.xml then either mention that (or *.xml or some particular pattern if there are more than one xml file generated in that folder.) in the pattern field and try it. 



--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/59b3c726-ff42-439c-abe6-0aedb26ae8d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages