From: gopala k. <gkn...@gm...> - 2010-08-19 14:42:04
|
Also I actually need to generate the coverage report with the cobertura.ser that got generated after the server shutsown. So as of now , I dont need to use maven site goal. I am looking for help on generating the coverage report from the .ser file where I am getting the error as follows build-all: [cobertura-report] Cobertura 1.9 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file [cobertura-report] Cobertura: Error reading file C:\cscr702\HarvestCopy\ITPAM Core\ITPAM\c2ocore\src\cobertura.ser: net.sourceforge.cobertura.coveragedata.CoverageDataContainer local class incompatible: stream classdesc serialVersionUID = 2152686494816595840, local class serialVersionUID = 2 [cobertura-report] Error: Unable to read from data file C:\cscr702\HarvestCopy\ITPAM Core\ITPAM\c2ocore\src\cobertura.ser What I am doing is I have maven.xml at the location where I have the .ser file with the following steps I have maven1.1 for the build system <?xml version="1.0"?> <project xmlns:j="jelly:core" xmlns:maven="jelly:maven" xmlns:ant="jelly:ant"> <goal name="build-all"> <ant:ant dir="${basedir}" antfile="build.xml" /> </goal> </project> and build.xml with these steps <?xml version="1.0" ?> <project name="ITPAM code coverage" default="collectReport"> <property name="itpambase.dir" value="C:\testproject"/> <property name="module.dir" value="${itpambase.dir}\module1"/> <property name="report.dir" value="Report"/> <property name="cobertura.dir" value="C:\ant\apache-ant-1.6.5\lib" /> <path id="cobertura.classpath"> <fileset dir="${cobertura.dir}"> <include name="cobertura-1.9.jar" /> <include name="log4j-1.2.9.jar" /> </fileset> </path> <taskdef classpathref="cobertura.classpath" resource="tasks.properties" /> <target name="collectReport" > <cobertura-report format="html" destdir="${report.dir}" > <fileset dir="${module.dir}"><include name="**/*.java" /></fileset> </cobertura-report> </target> </project> On 8/19/10, gopala krishna <gkn...@gm...> wrote: > > Actually when I try to run the "maven site" I am getting the following > error > > C:\cscr702\HarvestCopy\ITPAM Core\ITPAM>maven site > __ __ > | \/ |__ _Apache__ ___ > | |\/| / _` \ V / -_) ' \ ~ intelligent projects ~ > |_| |_\__,_|\_/\___|_||_| v. 1.1-beta-2 > > build:start: > > site: > xdoc:register-reports: > maven-cobertura-plugin:register: > > > site:run-reports: > > xdoc:init-i18n: > [echo] Init the i18n support > > xdoc:init: > [echo] Generates the directory structure required for xdocs > > xdoc:i18n-validation: > [echo] Validation of the locale entries > > BUILD FAILED > File...... C:\Documents and > Settings\nekma01\.maven\cache\maven-xdoc-plugin-1.9.2\plugin.jelly > Element... j:arg > Line...... 618 > Column.... 70 > [Ljava.lang.Object; > Total time : 1 seconds > Finished at : Thursday, August 19, 2010 6:48:12 PM IST > > > > I have included the reports tag in the base level project.xml and > > <reports> > > <report>maven-cobertura-plugin</report> > > </reports> > > > > And in the base maven.xml, With in the goal that is invoked, I kept this > statement as > > <attainGoal name="cobertura:on"/> > > > > Ex: > > <goal name="build-all"> > > *<attainGoal name="cobertura:on"/>* > > <maven:reactor basedir="${basedir}" > > includes="*/project.xml" > > goals="build" > > banner="Building C2O" > > ignoreFailures="false"/> > > > > <j:if test="${oasis.maven.checkstyle=='true' }"> > > <attainGoal name="checkstyleall"/> > > </j:if> > > > > * <attainGoal name="cobertura:off"/>* > > * <attainGoal name="cobertura"/>* > > > > </goal> > > > > > > And in the maven.xml of the module, I kept the statements as > > <goal name="build"> > > *<attainGoal name="cobertura:on"/>* > > <maven:reactor basedir="${basedir}" > > includes="project.xml" > > goals="jar:install" > > banner="Building" > > ignoreFailures="false"/> > > > > </goal> > > <preGoal name="java:jar-resources"> > > > > > > At the end of the build, I got instrumented jars deployed to server. I > verified some features manually from the server and stopped the server. > Cobertura.ser got generated. > > > > Now I need to get the coverage report using this coverage.ser > > Please let me know whether the process I followed is correct or not and how > to get the report. > > Thanks > > Nekkanti > > > > > On 8/19/10, Jeff Jensen <jj...@ap...> wrote: >> >> You don’t say how you configured it nor ran it. >> >> >> >> Did you follow the instructions here? >> >> http://maven-plugins.sourceforge.net/maven-cobertura-plugin/index.html >> >> >> >> The easiest way is to configure the report as shown on that page and then >> gen the Maven site by running “maven site”. >> >> <reports> >> >> ... >> >> <report>maven-cobertura-plugin</report> >> >> ... >> >> </reports> >> >> >> >> >> >> >> >> *From:* gopala krishna [mailto:gkn...@gm...] >> *Sent:* Thursday, August 19, 2010 5:43 AM >> *To:* cob...@li... >> *Subject:* [Cobertura-devel] generate report with cobertura maven1.1 >> plugin >> >> >> >> Hi, >> >> >> >> I have maven1.1 and I downloaded plugin "maven-cobertura-plugin-1.4.jar" >> and placed it under "C:\maven-1.1-beta-2\plugins" dir. >> >> >> >> I have instrumented the code and was deployed to server. After some >> testing I stopped the server. Cobertura.ser file got created at server. >> >> >> >> Now how to generate the coverage report using this cobertura.ser file with >> maven.xml? >> >> can you please tell me what should I do to get the report? >> >> >> >> Actually when I try to do it , I am getting error message as follows >> >> build-all: >> [cobertura-report] Cobertura 1.9 - GNU GPL License (NO WARRANTY) - See >> COPYRIGHT file >> [cobertura-report] Cobertura: Error reading file >> C:\cscr702\HarvestCopy\ITPAM Core\ITPAM\c2ocore\src\cobertura.ser: >> net.sourceforge.cobertura.coveragedata.CoverageDataContainer >> local class incompatible: stream classdesc serialVersionUID = >> 2152686494816595840, local class serialVersionUID = 2 >> [cobertura-report] Error: Unable to read from data file >> C:\cscr702\HarvestCopy\ITPAM Core\ITPAM\c2ocore\src\cobertura.ser >> >> BUILD FAILED >> >> >> >> >> >> Thanks in advance >> >> Nekkanti >> > > |