0

私のmavenプロジェクトでは、開発および統合環境用に異なるlog4j構成を使用しており、Webアプリケーションの主な用途とは異なるテスト目的の構成も使用しています。にあります :

  • src/main/resources/dev/log4j.properties
  • src/main/resources/int/log4j.properties
  • src/test/resources/dev/log4j_test.properties
  • src/test/resources/int/log4j_test.properties

だから私はそれらの違いを管理するために異なるプロファイル(DEV / INT)を持っています...

そして、surefire (単体テストに使用) および failsafe (統合テストに使用) プラグインのために、いくつかの構成を追加しました。

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-failsafe-plugin</artifactId>
  <version>2.19.1</version>
  <executions>
    <execution>
    <goals>
      <goal>integration-test</goal>
      <goal>verify</goal>
    </goals>
    </execution>
  </executions>
  <configuration>
    <systemPropertyVariables>
    <log4j.configuration>file:${basedir}/${profile.test.resource}/log4j_test.properties</log4j.configuration>
    </systemPropertyVariables>
    <!-- Stop the integration tests after the first failure to keep in database
    the content of the failed test. -->
    <skipAfterFailureCount>1</skipAfterFailureCount>
    <includes>
    <!-- Include only integration tests -->
    <include>**/*IntegrationTest.java</include>
    </includes>
    <skip>${skip.integration.tests}</skip>
  </configuration>
</plugin>

しかし今、DEV モードでの GWT 固有の単体テスト用に gwt-maven-plugin を追加しています。

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>gwt-maven-plugin</artifactId>
  <version>2.7.0</version>
  <executions>
    <execution>
      <goals>
        <goal>compile</goal>
        <goal>i18n</goal>
        <goal>generateAsync</goal>
        <goal>test</goal>
      </goals>
    </execution>
  </executions>

  <configuration>
    <runTarget>Appication.html</runTarget>
    <webappDirectory>${webappDirectory}</webappDirectory>
    <hostedWebapp>${webappDirectory}</hostedWebapp>
    <i18nMessagesBundles>
      ...               
    </i18nMessagesBundles>

    <extraJvmArgs>${gwt.extra.args}</extraJvmArgs>
    <style>${compile.style}</style>
    <module>${module.name}</module>
  </configuration>
</plugin>

特定の/フィルター処理された lop4j を指すように設定することは可能ですか?

ありがとう、

4

1 に答える 1

1

システムプロパティをextraJvmArgsで渡すことができます

于 2016-10-26T20:54:47.967 に答える