in Eclipse Ich habe EcLEmma verwendet, um die Unit-Test-Code-Abdeckung zu sehen. das hat gut funktioniert. Deshalb habe ich versucht, das jacoco-Plugin für Maven zu verwenden, um den gleichen Bericht mit todsicheren Maven Build oder noch besser mit einem bestimmten Profil oder im Site-Zyklus zu sehen. Alle kläglich gescheitertmaven unit Testcode Abdeckung
Alle schlagen hier Lösungen nicht für mich arbeiten
was ist der beste Weg, um einen UniSt Test Code-Coverage-Bericht (mit todsicherem) zu bekommen? [Bearbeiten] mehr spefici, warum jacoco für mich im Stich gelassen .... da ich aufgrund fehlender Ausführungsdaten
vom pom in den Eigenschaften
<jacoco.it.execution.data.file>${project.build.directory}/coverage-reports/jacoco-it.exec</jacoco.it.execution.data.file>
<jacoco.ut.execution.data.file>${project.build.directory}/coverage-reports/jacoco-ut.exec</jacoco.ut.execution.data.file>
alswas der Skipping JaCoCo Ausführung bekam im Build Abschnitt
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<versionRange>${jacoco.version}</versionRange>
<executions>
<!-- Prepares the property pointing to the JaCoCo runtime agent
which is passed as VM argument when Maven the Surefire plugin is executed. -->
<execution>
<id>pre-unit-test</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<!-- Sets the path to the file which contains the execution
data. -->
<destFile>${jacoco.ut.execution.data.file}</destFile>
<!-- Sets the name of the property containing the settings for
JaCoCo runtime agent. -->
<propertyName>surefireArgLine</propertyName>
</configuration>
</execution>
<!-- Ensures that the code coverage report for unit tests is created
after unit tests have been run. -->
<execution>
<id>post-unit-test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<!-- Sets the path to the file which contains the execution
data. -->
<dataFile>${jacoco.ut.execution.data.file}</dataFile>
<!-- Sets the output directory for the code coverage report. -->
<outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
</configuration>
</execution>
<!-- Prepares the property pointing to the JaCoCo runtime agent
which is passed as VM argument when Maven the Failsafe plugin is executed. -->
<execution>
<id>pre-integration-test</id>
<phase>pre-integration-test</phase>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<!-- Sets the path to the file which contains the execution
data. -->
<destFile>${jacoco.it.execution.data.file}</destFile>
<!-- Sets the name of the property containing the settings for
JaCoCo runtime agent. -->
<propertyName>failsafeArgLine</propertyName>
</configuration>
</execution>
<!-- Ensures that the code coverage report for integration tests
after integration tests have been run. -->
<execution>
<id>post-integration-test</id>
<phase>post-integration-test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<!-- Sets the path to the file which contains the execution
data. -->
<dataFile>${jacoco.it.execution.data.file}</dataFile>
<!-- Sets the output directory for the code coverage report. -->
<outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
</configuration>
</execution>
</executions>
</pluginExecutionFilter>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
war mein letzter Versuch, aber die pom wird größer und größer ohne Ergebnis
die Failes mit
Konfiguration Bericht Plugin org.apache.maven.plugins: Maven-jxr-Plugin: 2.3
Konfiguration Bericht org.jacoco Plugin: jacoco-Maven-Plugin: 0.7.5.201505241946
Skipping JaCoCo Ausführung durch Ausführung Datendatei fehlt: ...... \ target \ jacoco.exec
Skipping JaCoCo Ausführung aufgrund fehlender Dateiausführungsdaten: ...... \ target \ jacoco-it .exec
....=> Langer Projektpfad
Verwendung so etwas wie das jacoco Plugin oder dem cobertura Plugin. Was ist das? Sie sagen, Sie haben das schon ausprobiert und es ist "kläglich gescheitert"? Hmmm. Nun, wenn ich wüsste, was "kläglich gescheitert" * aussah, * könnte ich vielleicht helfen, aber so wie es ist, denke ich, dass du kein Glück hast. – dcsohl
Sie verwenden das 'jacoco-maven-plugin'? Erkläre, was du getan hast und probier es bitte, dann könnten wir Ale sein, um zu helfen. – RobAu
die pom Fragmente für jacoco zur Frage hinzugefügt – user3732793