Cobertura在多模块应用程序上创建0%的报告(可能的配置问题)

时间:2013-09-05 08:35:14

标签: maven-3 cobertura maven-surefire-plugin

我在使用cobertura创建报告时遇到问题。我还使用 surefire插件,配置为<skip>true</skip>但在执行元素中的集成测试阶段设置为<skip>false</skip>

我将cobertura的执行配置为与<goal>cobertura</goal>相同的阶段(集成测试)。它适用于单个模块,但是当我在父pom上运行它时,它只会创建 0%报告覆盖率。我也设置了<aggregate>true</aggregate>

说实话,我不确定如何正确配置coberura,所以我在这里寻求帮助。我认为它可能是“错误的阶段”问题或者在surefire插件中设置的arg或者其他东西。

我正在使用cobertura maven插件2.5.1,maven 3.0.4,surefire 2.14和jdk6。

小控制台输出(似乎测试后来运行):

[INFO] ------------------------------------------------------------------------
[INFO] Building BasicService 12.1.24-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ BasicService ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ BasicService ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ BasicService ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ BasicService ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.14:test (default-test) @ BasicService ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ BasicService ---
[INFO] Building jar: D:\workspaces\kepler-R\trunk\commonLogic\ntas\BusinessServices\BasicService\target\BasicService-12.1.24-SNAPSHOT.j
[INFO]
[INFO] >>> cobertura-maven-plugin:2.5.1:cobertura (default) @ BasicService >>>
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ BasicService ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ BasicService ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- cobertura-maven-plugin:2.5.1:instrument (default) @ BasicService ---
[INFO] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
Cobertura: Loaded information on 9 classes.
Instrumenting 9 files to D:\workspaces\kepler-R\trunk\commonLogic\ntas\BusinessServices\BasicService\target\generated-classes\cobertura
Cobertura: Saved information on 9 classes.
Instrument time: 328ms

[INFO] Instrumentation was successful.
[INFO] NOT adding cobertura ser file to attached artifacts list.
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ BasicService ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ BasicService ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.14:test (default-test) @ BasicService ---
[INFO] Tests are skipped.
[INFO]
[INFO] <<< cobertura-maven-plugin:2.5.1:cobertura (default) @ BasicService <<<
[INFO]
[INFO] --- cobertura-maven-plugin:2.5.1:cobertura (default) @ BasicService ---
[INFO] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
Cobertura: Loaded information on 9 classes.
Report time: 594ms

[INFO] Cobertura Report generation was successful.
[INFO] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
Cobertura: Loaded information on 9 classes.
Report time: 813ms

[INFO] Cobertura Report generation was successful.
[INFO]
[INFO] --- maven-surefire-plugin:2.14:test (default) @ BasicService ---
[INFO] Surefire report directory: D:\workspaces\kepler-R\trunk\commonLogic\ntas\BusinessServices\BasicService\target\surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.kogerusa.services.BasicServiceTest
08:48:55,371  INFO TransactionManagerFactory:148 - Standalone Bitronix transaction manager has been set
08:48:55,386  INFO TransactionManagerFactory:109 - Hibernate session factory bean has been configured for Bitronix JTA
...

0 个答案:

没有答案