2016-10-26 19 views
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?*

感谢,

回答

1

可以在extraJvmArgs

+0

通过系统属性谢谢。完全明显而简单......毕竟...... :) –