问题
I am using the Emma tool in Maven project. Emma creates line by line code coverage in HTML file, it does not display line by line code coverage XML file. It gives only a summary XML file. Is there a way to keep or generate line by line code coverage XML file in Emma?
I have entered following plugin in my pom.xml
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.7</version>
<configuration>
<dependencyLocationsEnabled>false</dependencyLocationsEnabled>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>emma-maven-plugin</artifactId>
<version>1.0-alpha-3</version>
<inherited>true</inherited>
</plugin>
</plugins>
</reporting>
Am I missing any configuration? If so where should I enter it in pom? (A complete pom.xml
file will be appreciated).
I have created my project using Eclipse and ran it in cmd using the code:
mvn emma:emma
also i have entered following inside the Emma-maven pluggin
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
回答1:
Yes, you can set the property maven.emma.report.xml to true
to generate a XML report (it is false
by default). The file target/coverage.xml
will be generated.
Sample command:
mvn emma:emma -Dmaven.emma.report.xml=true
来源:https://stackoverflow.com/questions/33724313/how-to-get-line-by-line-coverage-xml-file-in-emma-maven-project