构建一个 maven jetty 项目
1. 配置 jetty 插件在pom中
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.curiousby.cn</groupId> <artifactId>MavenJettyRunDemo</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>war</packaging> <name>MavenJettyRunDemo</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.3</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.4.2</version> <configuration> <skipTests>false</skipTests> <testFailureIgnore>true</testFailureIgnore> <argLine>${argLine}</argLine> </configuration> </plugin> <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>7.1.6.v20100715</version> <configuration> <webAppConfig> <contextPath>/jettyTest</contextPath> </webAppConfig> <connectors> <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector"> <port>8084</port> <maxIdleTime>60000</maxIdleTime> </connector> </connectors> </configuration> </plugin> </plugins> </build> </project>
2. web .xml
<?xml version="1.0" encoding="UTF-8"?> <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" metadata-complete="true"> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app>
3. index.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> </head> <body> Hello world! </body> </html>
4. 运行 命令 maven bulid -> mvn jetty:run
或者 配置
5.测试
6. 删除进程
在win 中 jetty 启动后进程未删除,导致后期的jetty run 启动不起来,所以要删除 进程
捐助开发者
在兴趣的驱动下,写一个免费
的东西,有欣喜,也还有汗水,希望你喜欢我的作品,同时也能支持一下。 当然,有钱捧个钱场(右上角的爱心标志,支持支付宝和PayPal捐助),没钱捧个人场,谢谢各位。
谢谢您的赞助,我会做的更好!
相关推荐
jetty maven pom run ---------------------------------------- http://knight-black-bob.iteye.com/blog/2360698
使用 如果Eclipse 安装了Maven插件,选 择pom.xml文件,击右键——>选择 Run As——> Maven build。 三、在eclipse上安装maven插件 1、在线安装 略。 2、离线安装 下载maven的eclipse插件包 解压到eclipse...
配置Jetty插件 5.5. 添加一个简单的Servlet 5.6. 添加J2EE依赖 5.7. 小结 6. 一个多模块项目 6.1. 简介 6.1.1. 下载本章样例 6.2. simple-parent 项目 6.3. simple-weather 模块 6.4. simple-webapp ...
使用maven整合的中英文验证码,使用注解的servlet3实现。其中pom配置了jetty和tomcat7,可以使用jetty:run或tomcat7:run。 项目使用UTF-8编码,导入eclipse请注意UTF-8编码
端口默认用了8088,如需修改,前往pom.xml,找到maven-jetty-plugin插件的port参数. jetty安装配置 ------------------- 从 http://download.eclipse.org/jetty/ 中下载jetty 文件,命令 unzip 解压zip文件 在...
输入jetty:run -X 输入-noverify -javaagent:D:/java/spring/jrebel.jar 3、在pom.xml中加入下面信息 <plugin> <groupId>org.zeroturnaround</groupId> <artifactId>javarebel-maven-plugin <id>...
jmeter-maven-plugin-it jmeter-maven-plugin 的集成测试。 用于运行测试。... 为了使版本、依赖和插件管理尽可能简单, jmeter-maven-plugin-it模块和封闭的jmeter-maven-plugin-it-run模块(运行
使用命令提示符或终端的现有Pom.xml文件夹运行命令mvn -P dev jetty:run -Dspring.profiles.active="dev"在开发阶段mvn -P dev jetty:run -Dspring.profiles.active="dev" mvn jetty:run进入生产阶段Web服务器可以...
右键项目,run as maven build... --> Goals: jetty:run #启动配置 前提准备,已经申请到QQ互联的APP_ID, APP_KEY i)在demo中找到src/main/resources/connect.properties这个文件 ii)正确填写APP_ID, APP_...
##如何运行####1、到Somnus/pom.xml修改数据库配置:默认修改:Somnus\src\main\resources\config.properties下的jdbc.usernamejdbc.password在你的数据库中,新建一个仓库,名字必须和jdbc.url中的一致####2、到...
右击pom.xml -> Run As -> Maven build -> 在Goals中输入jetty:run, 将启动jetty服务器。 这里的jetty是maven的一个jetty的插件,你也可以是用tomcat等其它服务器软件来启动项目 打开浏览器,输入或来测试 例子 ...
CUI Java Web应用程序包装CUI下载的基本Web应用程序。 Maven项目具有Tomcat码头和Tomcat的servlet依赖关系和maven... mvn clean installmvn jetty:run将mvn tomcat7:run替换为mvn jetty:run以在tomcat下运行。 浏览至:
mvn jetty:run-war 在访问 solr 服务器 Solr 配置位于solr/目录中。 因为solr.home变量没有设置,所以 Solr 将默认为这个。 如果你想改变solr.home的值,你可以这样做: mvn -Dsolr.solr.home=myhome jetty:run-...
一个码头插件已经在maven pom.xml中注册,您可以通过在此目录中的命令行中简单键入mvn jetty:run来启动该应用程序。 因此,请在执行此命令之前更改提示,并等待以下日志输入[INFO] Started Jetty Server出现。 ...
在生成pom.xml调整Maven项目属性browser 生成新项目: mvn archetype:generate -DachetypeCatalog=local -DarchetypeGroupId=...
在eclipse中,右键点击项目名,选择Run as-Maven build...,Goals填入jetty:run或tomcat7:run,然后点击Run。 访问系统。前台地址:http://localhost:8080/web,手机站地址:http://127.0.0.1:8080/;后台地址:...
jetty:run 然后,您只需将浏览器指向即可查看它的运行情况。 兼容性 此插件与 Vaadin 7 兼容。 Vaadin 6 的画布插件可用。 安装 要将附加组件安装到您的 Vaadin 项目,只需从 复制 JAR 文件,然后编译您的小部件集...
斯克拉德格雷 营地仓库管理应用程序...仍在开发中。 技术:Spring、Spring Web MVC、JSP、JSTL、HTML5、CSS3、3层架构、Maven、Hibernate、... 启动应用程序: mvn jetty: run (或: clean package jetty: run) ... at
lmvc示例 漏洞-模型-视图-控制器框架示例 先决条件 Open-JDK / Oracle-JDK-1.9或更高版本 apt-get install openjdk-9-jdk Maven 3或更高 apt-get安装maven 漏洞MVC ... mvn clean package jetty:run
$ mvn jetty:run 打开 在IntelliJ IDEA 14中导入 这些说明已在IntelliJ IDEA 14 CE上进行了测试。 您可以从获得 要在IDEA中启动并运行项目,请执行以下操作: 文件->新建->版本控制中的项目-> Git 使用的URL是 ...