Posts

Showing posts from April, 2009

com.vladium.emma.EMMARuntimeException: [CLASS_STAMP_MISMATCH]

Emma is used for finding the code coverage of JUnit test classes. When running Emma with a JEE container, the source .class files (not the .java files) are first instrumented and then deployed on the J2EE server. Then the test classes are executed from ant command line or via an Eclipse plug-in, and this will write out the coverage data into .em or .ec files. Sometimes, an error observed when running Emma is emma.report: [report] processing input files ... [report] 2 file(s) read and merged in 172 ms [report] com.vladium.emma.EMMARuntimeException: [CLASS_STAMP_MISMATCH] runtime version of class [com.xyz.action.MyAction] in the coverage data is not consistent with the version of this class in the metadata, possibly because stale metadata is being used for report generation. [report] at com.vladium.emma.report.ReportDataModel.getView(ReportDataModel.java:95) [report] at com.vladium.emma.report.AbstractReportGenerator.initialize(AbstractReportGenerator.java:207) ...

Running Maven offline using local Repository

Sometimes you see Maven downloading POM files for dependencies which are already in your local repository and you're wondering why it does this. Downloading: http://repo1.maven.org/maven2//org/apache/xmlgraphics/fop/0.95/fop- 0.95.pom Downloading: http://repo1.maven.org/maven2//org/apache/xmlgraphics/xmlgraphics-c ommons/1.3.1/xmlgraphics-commons-1.3.1.pom Downloading: http://repo1.maven.org/maven2//org/apache/xmlgraphics/batik-svg-dom /1.7/batik-svg-dom-1.7.pom The reason it does is because when these were installed in the local repository, it was not given a flag of -Dgenerate.pom=true If you run the install with this flag, then it will generate and install a local POM file for you, and will not download the POM from the internet repository. An example below mvn install:install-file -DgroupId=%GROUP_ID% -DartifactId=%ARTIFACT_ID% -Dversion=%VERSION% -Dfile=%COMPONENT%.jar -Dpackaging=jar -DgeneratePom=true There are 2 other ways to run the build without connecti...