[英]overriding system properties in maven
I have a web application with a couple of profiles - for production and for local testing; 我有一个带有几个配置文件的Web应用程序-用于生产和本地测试。 build is executed with maven; 用maven执行构建; logback is used for logging logback用于记录日志
so some of logs write to files - the problem is: in production we use tomcat and CATALINA_HOME is set on server, but locally we often use jetty, so tomcat may even not be configured 所以一些日志写入文件-问题是:在生产中,我们使用tomcat并且在服务器上设置了CATALINA_HOME,但是在本地我们经常使用码头,因此甚至可能未配置tomcat
so in prod i want to write log in file this way: ${catalina.home}/logs/profiler.%d{yyyy-MM-dd}.log 所以在生产中,我想以这种方式写入登录文件:$ {catalina.home} /logs/profiler.%d {yyyy-MM-dd} .log
how do I set maven override this ${catalina.home} property 我如何设置Maven覆盖此$ {catalina.home}属性
thanks a lot! 非常感谢! tatiana. 塔蒂亚娜。
You can define a maven property
, say log.dir
and set it to appropriate values in each profile
. 您可以定义一个maven property
,例如log.dir
并在每个profile
中将其设置为适当的值。
Say, 说,
<profile>
<id>dev</id>
<properties>
<log.dir>${catalina.home}/...</log.dirv>
</properties>
</profile>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.