idea~创建maven webapp项目

1、选择

org.apache.maven.archtypes:maven-archtype-webapp

2、禁止远程下载

archetypeCatalog=internal

目的是不远程下载,否则始终【downloading maven plugins...】

3、jetty

<build>
    <finalName>myprj</finalName>
    <plugins>
      <plugin>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-maven-plugin</artifactId>
        <version>9.3.27.v20190418</version>
        <configuration>
          <httpConnector>
            <port>9999</port>
          </httpConnector>
          <scanIntervalSeconds>10</scanIntervalSeconds>
          <webAppConfig>
            <contextPath>/myprj</contextPath>
          </webAppConfig>
        </configuration>
      </plugin>
    </plugins>
  </build>

参见:https://www.cnblogs.com/yaoyuan2/p/10577785.html

最终目录结构:

 

问题:jetty运行时,修改html或css或js文件时,会出现jb_old,怎么办?

解决:

进入:D:\env\plugins\maven\repository\org\eclipse\jetty\jetty-webapp\9.3.27.v20190418

用7zip打开jetty-webapp-9.3.27.v20190418.jar,一路点击到底,找到webdefault.xml,找到useFileMappedBuffer,将原来的true修改为:false

 

posted @ 2019-10-06 19:10  遥远2  阅读(909)  评论(0编辑  收藏  举报