方式一、采用mortbay插件:

1、pom.xml

<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.15.v20140411</version>
<configuration>
<stopKey>stop</stopKey>
<stopPort>9998</stopPort>
<scanIntervalSeconds>1</scanIntervalSeconds>
<contextXml>${project.basedir}/src/test/resources/jetty-context.xml</contextXml>
<webApp>
<contextPath>/${project.artifactId}</contextPath>
</webApp>
<connectors>
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port>9999</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
</configuration>
</plugin>

注:对于org.eclipse.jetty.server.nio.SelectChannelConnector,即使没引入该jar包,也没影响。

2、jetty-context.xml

关键是在${project.basedir}/src/test/resources/目录下,创建文件:jetty-context.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Call name="setAttribute">
<Arg>org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern</Arg>
<Arg>.*/.*jsp-api-[^/]\.jar$|./.*jsp-[^/]\.jar$|./.*taglibs[^/]*\.jar$</Arg>
</Call>
</Configure>

3、右上角maven窗口【刷新】,后,

方式二、采用eclipse插件:

1、jetty&jdk版本

9.3----->1.8
9.2----->1.7
8------->1.6

参考:https://www.eclipse.org/jetty/documentation/current/jetty-maven-plugin.html

2、pom.xml

<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.2.26.v20180806</version>
<configuration>
<httpConnector>
<port>9999</port>
</httpConnector>
<scanIntervalSeconds>10</scanIntervalSeconds>
<webAppConfig>
<contextPath>/ebc_signpdf</contextPath>
</webAppConfig>
</configuration>
</plugin>

我用eclipse下的jetty插件时,报错:java.lang.Exception: Timeout scanning annotations。需要每次启动时,执行

mvn jetty:run -Dorg.eclipse.jetty.annotations.maxWait=120

才能解决,但是过于麻烦,因此建议采用mortbay插件。

idea(3)-jetty配置的更多相关文章

  1. IntelliJ IDEA使用(二):tomcat和jetty配置

    上一讲用idea创建了maven web项目,接下来我们把项目发布到tomcat和jetty运行,以便进一步地开发和调试 配置tomcat 第一.打开菜单栏 第二.点击设置按钮,添加应用服务器,选择t ...

  2. 阿里云服务器Linux CentOS安装配置(五)jetty配置、部署

    阿里云服务器Linux CentOS安装配置(五)jetty配置.部署 1.官网下载jetty:wget http://repo1.maven.org/maven2/org/eclipse/jetty ...

  3. IntelliJ IDEA使用(二):tomcat和jetty配置(转自:http://www.cnblogs.com/jenkinschan/p/6052948.html)

    上一讲用idea创建了maven web项目,接下来我们把项目发布到tomcat和jetty运行,以便进一步地开发和调试 配置tomcat 第一.打开菜单栏 第二.点击设置按钮,添加应用服务器,选择t ...

  4. idea jetty 配置

    一.jetty 网址下载地:https://www.eclipse.org/jetty/ 1.如下图红色箭头--> 点击Downloads 下载 2.选择最新版 .ZIP 下载 3.选择安装路径 ...

  5. Jetty配置

    类似TomCat 登陆官网www.eclipse.org Download下载Jetty zip压缩版 解压到文件夹,打开idea的Config->Jetty-server->Local- ...

  6. apache+jetty 配置web jsp服务器负载均衡

    首先,查找中文资料,貌似很少,有一个网友写了点,但是1版本过老,2有些地方有错误. 经过我自己摸索,记录一下.这个图很简洁明了 第一阶段 ,配置jetty 首先从 http://download.ec ...

  7. maven jetty 配置

    对于jdk8增加如下配置: <plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jett ...

  8. JDK1.7 和 jetty配置教程

    系统是windows 7 64位版本,32位版本同理,xp系统的自己google设置环境变量 打开设置环境变量窗口,右键计算机->我的电脑,选择属性 点击高级系统设置 选择环境变量 红线为需要设 ...

  9. 内置Jetty配置JSP支持过程中的常见报错

    目录 1. 常见报错及解决 1.1 JSP support not configured 1.2 JSTL标签解析 1.3 JSP编译 1.4 JSP实现依赖 1.5 EL表达式支持 2. 小结 1. ...

  10. Jetty配置虚拟目录,实现把web项目发布到自定义目录,指定指定上下文访问;jetty编码修改

    2019-12-31     17:28:38 一般只需要把Java站点文件夹或*.war文件拷贝到Web Server的webapps文件夹下,即可启动运行该站点,但更多时候,我们并不想拷贝站点,而 ...

随机推荐

  1. POJ 3714 分治/求平面最近点对

    第一次见这种问题直接懵圈...没想到分治法这么强大,借鉴了lyd的代码: 代码如下 #include<cstdio> #include<algorithm> #include& ...

  2. Python 网络爬虫 007 (编程) 通过网站地图爬取目标站点的所有网页

    通过网站地图爬取目标站点的所有网页 使用的系统:Windows 10 64位 Python 语言版本:Python 2.7.10 V 使用的编程 Python 的集成开发环境:PyCharm 2016 ...

  3. 用fontcreator创建了一个半成品的字体

    下效果,哈哈. 为啥说半成品呢?因为只制作了0到9这几个字符,其他的字母.汉字.符号啥的都没有制作,唯一感觉就是字体设计是一个非常有设计感的活儿,而且需要付出很多的精力,尤其是汉字字体,常见的有6k多 ...

  4. tab页以及jqgrid某些用法参考记录

    <%@ Page Language="C#" AutoEventWireup="True" CodeBehind="CcrCreditHuman ...

  5. 几种jar转exe方法的比较

    原摘自:https://blog.csdn.net/uikoo9/article/details/7458666 几种jar转exe方法的比较 2012年04月13日 17:33:07 阅读数:153 ...

  6. HTML中关于url、scr、href的区别

    URL是什么 URL:Uniform Resource Locators(统一资源定位器)的简写,Web浏览器通过URL从Web服务器请求页面. url不是属性,src和href是属性,src用于替换 ...

  7. postgre-sql语法

    //客户端查询 public void pgsearchclient(HttpContext context, string starttime, string endtime, int page, ...

  8. 使用穷人版profiler定位调试MySQL

    此文已由作者温正湖授权网易云社区发布. 欢迎访问网易云社区,了解更多网易技术产品运营经验. 周末闲得蛋疼,来英飞特做人工空气净化器.开了电脑后,习惯性得点击xshell按钮,进入InnoSQL稳定性测 ...

  9. metasploit 读书笔记1

    The msfpayload component of Metasploit allows you to generate shellcode, executables, and much more ...

  10. Win10下Tensorflow+GPU的环境配置

    不得不说,想要为深度学习提前打好框架确实需要花费一番功夫.本文主要记录了Win10下,Cuda9.0.Cudnn7.3.1.Tensorflow-gpu1.13.1.python3.6.8.Keras ...