一、如果这个工程是标准的maven-webapp那么基本上不用修改,直接运行jetty:run就可以执行。

但是有时候会报错说

[ERROR] No plugin found for prefix 'jetty' in the current project and in the plu
gin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repo
sitories [local (C:\Documents and Settings\reymont.li\.m2\repository), central (
http://repo.maven.apache.org/maven2)] -> [Help 1]

在pom.xml的project.build节点下添加

<plugins>
 <plugin>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>maven-jetty-plugin</artifactId>
        <version>6.1.10</version>
        
  </plugin>
  </plugins>

In order to run Jetty on a webapp project which is structured according to the usual Maven defaults (resources in ${basedir}/src/main/webapp, classes in${project.build.outputDirectory}
and the web.xml descriptor at ${basedir}/src/main/webapp/WEB-INF/web.xml,
you don't need to configure anything.

Simply type:

mvn
jetty:run

This will start Jetty running on port 8080 and serving your project. Jetty will continue to run until the plugin is explicitly stopped, for example, by a <cntrl-c>.

二、本来一直用jetty插件,换了Ubuntu后,在eclipse里装jetty插件总失败,就想放弃使用插件。

反正maven里已经配置好了jetty,用mvn jetty:run也能启动jetty服务,但是这样就不能用eclipse断点调试,比较不方便。上网调查了下,发现可以用eclipse external tool调用maven命令来执行mvn jetty:run,并能使用debug模式。于是写此文章,以做备忘。

1. Run -> External Tools -> External Tools Configurations

配置见下图

上图的工作路径是在front下,但是项目要求maven执行的时候在工程根目录下,可以用下图配置

切到Environment标签,增加如下变量

Name:MAVEN_OPTS

Value:-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8443,server=y,suspend=y

然后保存。

2 Run -> Debug Configurations

注意此处的端口号要和上面的一致。

保存,成功!

(转)利用eclipse external tool 执行mvn jetty:run的更多相关文章

  1. Command mvn jetty:run

    How to use the command mav jetty:run? There is a simple display as below: Step 1: You should generat ...

  2. spring3-mvc-maven-hello-world-master mvn jetty:run 及 mvn war:war 指令

    spring3-mvc-maven-annotation-hello-world-master  mvn jetty:run Run this project locally Terminal $ m ...

  3. mvn jetty:run 出现PermGen space outofmemeryerror

    使用mvn jetty:run跑别人的项目时出现了PermGen space outofmemeryerror异常 http://stackoverflow.com/questions/1451648 ...

  4. Eclipse External Tool Configration Notepad++

    Location: C:\Program Files\Notepad++\notepad++.exe Arguments: ${resource_loc}

  5. Eclipse中使用Maven的Jetty插件Debug Web项目

    1.环境配置 JAVA_HOME=D:\Program Files\Java\jdk1.7.0_80 JRE_HOME=%JAVA_HOME%\jre CLASSPATH=.;%JAVA_HOME%/ ...

  6. 命令行执行 mvn package 和常见mvn命令

    cmd 打开命令提示符, 然后打开代码所在目录,例如 d: cd d:/code 执行 mvn package Maven常用命令:  1. 创建Maven的普通java项目:     mvn arc ...

  7. mvn jetty debug

    使用mvn jetty:run很爽吧,但是怎么debug了,找了Google的N多老外文章,终于可以了,文章链接:http://gaertig.pl/blog/en/2009/03/debug-jet ...

  8. Mvn+Jetty启动项目

    这里要注意,Mvn加jetty启动项目,主要用到的是Maven的jetty插件,和你下的Jetty服务器没什么关系. 我的运行环境是jdk1.7,Eclipse-mars,Maven是Eclipse自 ...

  9. eclipse中报错:Errors running builder “Integrated External Tool Builder” on project

    在eclipse构建项目的时候,一直报如下错误: Errors during build. Errors running builder "Integrated External Tool ...

随机推荐

  1. OC- .h与.m

    1.只有利用类名调用类方法的时候,不需要在类名后面写*.其他情况下,类名后面统一加上一个* Circle *c1 = [Circle new]; - (BOOL)isInteractWithOther ...

  2. 使用Alcatraz来管理Xcode插件(转)

    转自唐巧的博客:http://blog.devtang.com/blog/2014/03/05/use-alcatraz-to-manage-xcode-plugins/ 简介 Alcatraz是一个 ...

  3. Java多线程编程核心技术---线程间通信(一)

    线程是操作系统中独立的个体,但这些个体如果不经过特殊处理就不能成为一个整体.线程间的通信就是成为整体的必用方案之一.线程间通信可以使系统之间的交互性更强大,在大大提高CPU利用率的同时还会使程序员对各 ...

  4. Devexpress-1 DataGrid控件

    参考资料: 使用XtraGrid自定义列计算 DEV GridControl小结 实现对两列求和后作为新的列

  5. Collection类相关总结

    集合类的框架如下: Collection(接口)    List(接口):允许重复.         ArrayList         Vector         LinkedList    Se ...

  6. Web前端开发规范文档(google规范)

    (Xee:其实没什么规范约束,但是养成一种好习惯,何乐而不为?) 区分大小写 xhtml  区分大小写,xhtml要求 标签名 属性名 值都要小写,并且要有双引号和 标签闭合. css 元素名称以及i ...

  7. linux下的库冲突问题

    lib1.c #include <stdio.h>int fun(){ printf("lib1\n"); return 0;} lib2.c #include < ...

  8. R语言 recommenderlab 包

    recommend li_volleyball 2016年3月20日 library(recommenderlab) ## Warning: package 'recommenderlab' was ...

  9. 第2月第4天 injection plugin for xcode

    http://www.cocoachina.com/ios/20140530/8623.html http://www.jianshu.com/p/27be46d5e5d4

  10. php远程连接http方式

    以下这三者是通过GET方式来获取数据 1.socket 方式 一般是指定网址.端口号.超时时间. 再对报头进行修改以及传递参数,包括:header.method.content, 返回的内容包括hea ...