maven pom jetty run
2018-02-07 00:00
302 查看
构建一个 maven jetty 项目
demo下载
1. 配置 jetty 插件在pom中
2. web .xml
3. index.jsp
4. 运行 命令 maven bulid -> mvn jetty:run
或者 配置
5.测试
6. 删除进程
在win 中 jetty 启动后进程未删除,导致后期的jetty run 启动不起来,所以要删除 进程
谢谢您的赞助,我会做的更好!
demo下载
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捐助),没钱捧个人场,谢谢各位。
谢谢您的赞助,我会做的更好!
相关文章推荐
- Just for mark : Mac Idea maven--> jetty:run :debug 卡顿半年解决方案
- Project configuration is not up-to-date with pom.xml. Run Maven->Update Project or use Quick Fix
- Run Maven Java Web Application in Jetty Maven Plugin
- Maven 在pom.xml中配置Jetty出现'org.eclipse.jetty.server.nio.SelectChannelConnector' cannot be loaded异常
- fail to execute goal org.eclipse.jetty:jetty-maven-plugin:jetty:run Address already in use
- [Maven in action] 解决办法:Project configuration is not up-to-date with pom.xml. Run project ...
- Maven Jetty Plugin运行配置jetty:run
- Maven Jetty Plugin运行配置jetty:run
- Maven异常Type Project configuration is not up-to-date with pom.xml. Run Maven->Update Project or use Quick Fix
- run-jetty-run - Jetty Eclipse Plugin! Best plugin for running Jetty in Eclipse! Jetty,Eclipse,Maven,Web - Google Project Hosting
- DescriptionResourcePathLocationType Project configuration is not up-to-date with pom.xml. Run Maven-
- 使用maven的tomcat:run进行web项目热部署(通过Maven的Tomcat插件运行Web工程,在pom中添加tomcat插件,使项目能在eclipse中跑起来,但如果部署需安tomcat)
- maven项目报:Project configuration is not up-to-date with pom.xml. Run Maven->Update Project
- [memo]maven pom 设置war包、jetty插件点滴
- maven jetty run
- Project configuration is not up-to-date with pom.xml. Run Maven->Update Project or use Quick Fix
- Maven Jetty Plugin运行配置jetty:run
- ubuntu 16.04 eclipse,maven,jetty install and run
- maven jetty eclipse run stop debug 调试java web项目
- 如何在maven的pom.xml中配置jetty插件?