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

最终目录结构:

idea~创建maven webapp项目

 

问题: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

 

相关文章:

  • 2021-11-29
  • 2022-12-23
  • 2021-12-20
  • 2021-03-30
猜你喜欢
  • 2022-12-23
  • 2021-07-03
  • 2021-06-05
  • 2021-12-02
  • 2022-01-12
  • 2021-09-29
  • 2021-12-24
相关资源
相似解决方案