2

cobertura でレポートを作成する際に問題があります。私もsurefire pluginを使用していますが、これはに構成されて<skip>true</skip>いますが、実行要素内の統合テストフェーズ<skip>false</skip>では に設定されています。

cobertura の実行を と同じフェーズ (統合テスト) に構成しまし<goal>cobertura</goal>た。単一のモジュールで動作しましたが、親 pom で実行すると、0%のレポート カバレッジしか作成されません。また、私は設定しまし<aggregate>true</aggregate>た。

正直なところ、cobertura を Surefire で適切に構成する方法がわからないので、ここで助けを求めています。「間違ったフェーズ」の問題か、確実なプラグイン内の引数セットか、それ以外の可能性があると思います。

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
...
4

0 に答える 0