Maven+jetty锁定js,css问题

来源:互联网 发布:grpc java 使用 编辑:程序博客网 时间:2024/06/07 05:25

1.在你使用的Jetty版本的jetty.jar中找到webdefault.xml,它在jar文件中的路径是org/mortbay/jetty/webapp/webdefault.xml。把它拷贝到项目中,比如src/main/resources/webdefault.xml。

2.找到useFileMappedBuffer参数,把值设成false
3.pom.xml文件中

<plugin> 
    <groupId>org.mortbay.jetty</groupId> 
    <artifactId>jetty-maven-plugin</artifactId> 
    <version>8.1.13.v20130916</version> 
    <configuration> 
     <scanIntervalSeconds>2</scanIntervalSeconds> 
     <stopKey>foo</stopKey> 
     <stopPort>9999</stopPort> 
     <webAppConfig> 
      <contextPath>/</contextPath>
      <defaultsDescriptor>src/main/resources/webdefault.xml</defaultsDescriptor>
     </webAppConfig>
    </configuration>                 
   </plugin>

添加<defaultsDescriptor>src/main/resources/webdefault.xml</defaultsDescriptor>

0 0
原创粉丝点击