0
在我的maven項目中,我爲開發和集成環境配置了不同的log4j配置,我的webapp的用法。位於:gwt-maven-plugin確實加載了「主」log4j配置而不是「test」一個
- 的src/main /資源的/ dev/log4j.properties
- 的src /主/資源/ INT/log4j.properties
- 的src /測試/資源的/ dev/log4j_test.properties
- 的src /測試/資源/ INT/log4j_test.properties
所以,我有不同的配置文件(DEV/INT)來管理放入系統的差異...
而且對於s urefire(用於單元測試)和故障安全(用於集成測試)插件,我加了一些配置:
<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>
但現在我加入GWT-Maven的插件在DEV模式GWT特定的單元測試。
<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?*
感謝,
通過系統屬性謝謝。完全明顯而簡單......畢竟...... :) –