通过properties-maven-plugin为Jetty Maven Plugin添加系统变量

 

通过properties-maven-plugin为Jetty Maven Plugin添加系统初始化变量。也是为解决当将依赖放到Jetty Maven Plugin的dependencies下时,Jetty Maven Plugin不能通过自身的<systemProperties>找到日志的配置文件。

 

properties-maven-plugin配置:

Xml代码 

 收藏代码

  1. <plugin>  
  2.   <!-- As of Jetty 7.5.0 and above, Jetty classes now use static log initializers. These static log initializers cause the Log4j system to be initialized before system properties are loaded. Use a separate maven plugin such as the properties-maven-plugin to set the log4j system properties before the Jetty plugin is initialized. -->  
  3.   <groupId>org.codehaus.mojo</groupId>  
  4.   <artifactId>properties-maven-plugin</artifactId>  
  5.   <version>1.0-alpha-2</version>  
  6.   <executions>  
  7.     <execution>  
  8.       <phase>initialize</phase>  
  9.       <goals>  
  10.         <goal>set-system-properties</goal>  
  11.       </goals>  
  12.       <configuration>  
  13.         <properties>  
  14.           <property>  
  15.             <name>log4j.configuration</name>  
  16.             <value>file:/${jetty.home}/resources/log4j.properties</value>  
  17.           </property>  
  18.           <property>  
  19.             <name>snx.arch.asjndi.path</name>  
  20.             <value>${jetty.home}/etc/company/system/asJndi.properties</value>  
  21.           </property>  
  22.         </properties>  
  23.       </configuration>  
  24.     </execution>  
  25.   </executions>  
  26. </plugin>  

 

Jetty Maven Plugin

Xml代码 

 收藏代码

  1. <plugin>  
  2.   <groupId>org.mortbay.jetty</groupId>  
  3.   <artifactId>jetty-maven-plugin</artifactId>  
  4.   <version>8.1.10.v20130312</version>  
  5.   <configuration>  
  6.     <scanIntervalSeconds>10</scanIntervalSeconds>  
  7.     <connectors>  
  8.       <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">  
  9.         <port>9080</port>  
  10.         <maxIdleTime>60000</maxIdleTime>  
  11.       </connector>  
  12.     </connectors>  
  13.     <useProvidedScope>true</useProvidedScope>  
  14.     </configuration>  
  15.   <dependencies>  
  16.     <dependency>  
  17.       <groupId>org.slf4j</groupId>  
  18.       <artifactId>slf4j-log4j12</artifactId>  
  19.       <version>1.7.5</version>  
  20.     </dependency>  
  21.     <dependency>  
  22.       <groupId>log4j</groupId>  
  23.       <artifactId>log4j</artifactId>  
  24.       <version>1.2.14</version>  
  25.     </dependency>  
  26.   </dependencies>  
  27. </plugin>  
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Sunday_ding

一分钱也是爱

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值