(转)利用eclipse external tool 执行mvn jetty:run
一、如果这个工程是标准的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 |
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的更多相关文章
- Command mvn jetty:run
How to use the command mav jetty:run? There is a simple display as below: Step 1: You should generat ...
- 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 ...
- mvn jetty:run 出现PermGen space outofmemeryerror
使用mvn jetty:run跑别人的项目时出现了PermGen space outofmemeryerror异常 http://stackoverflow.com/questions/1451648 ...
- Eclipse External Tool Configration Notepad++
Location: C:\Program Files\Notepad++\notepad++.exe Arguments: ${resource_loc}
- Eclipse中使用Maven的Jetty插件Debug Web项目
1.环境配置 JAVA_HOME=D:\Program Files\Java\jdk1.7.0_80 JRE_HOME=%JAVA_HOME%\jre CLASSPATH=.;%JAVA_HOME%/ ...
- 命令行执行 mvn package 和常见mvn命令
cmd 打开命令提示符, 然后打开代码所在目录,例如 d: cd d:/code 执行 mvn package Maven常用命令: 1. 创建Maven的普通java项目: mvn arc ...
- mvn jetty debug
使用mvn jetty:run很爽吧,但是怎么debug了,找了Google的N多老外文章,终于可以了,文章链接:http://gaertig.pl/blog/en/2009/03/debug-jet ...
- Mvn+Jetty启动项目
这里要注意,Mvn加jetty启动项目,主要用到的是Maven的jetty插件,和你下的Jetty服务器没什么关系. 我的运行环境是jdk1.7,Eclipse-mars,Maven是Eclipse自 ...
- eclipse中报错:Errors running builder “Integrated External Tool Builder” on project
在eclipse构建项目的时候,一直报如下错误: Errors during build. Errors running builder "Integrated External Tool ...
随机推荐
- mysql中DATETIME,DATE和TIMESTAMP的区别整理
简而言之.看格式,DATE 是 年月日YYYY-MM-DD,DATETIME 是 年月日时分秒YYYY-MM-DD HH:MM:SS,TIMESTAMP是 年月日时分秒YYYY-MM-DD HH:MM ...
- 跳出iframe
摘要 有时候需要用到iframe,但里面的单击里面的链接的时候,总是在该iframe中打开. 解决办法 其实解决起来也很简单. 在iframe中的head标签中添加下面的标签即可. <base ...
- C语言之strrchr函数
from:http://blog.csdn.net/hgj125073/article/details/8443912 [FROM MSDN && 百科] 原型:char *strrc ...
- JSF页面中使用js函数回调后台bean方法并获取返回值的方法
由于primefaces在国内使用的并不是太多,因此,国内对jsf做系统.详细的介绍的资料很少,即使有一些资料,也仅仅是对国外资料的简单翻译或者是仅仅讲表面现象(皮毛而已),它们的语句甚至还是错误的, ...
- acdream1233 Royal Federation (构造?)
http://acdream.info/problem?pid=1233 Andrew Stankevich's Contest (3) ASC 3 Royal Federation Special ...
- ExtJS -- Grid 文本居中显示
Reference: http://stackoverflow.com/questions/6561120/extjs-4-apply-defaults-to-all-columns-in-a-gri ...
- 字符编码详解及由来(UNICODE,UTF-8,GBK)
一直对字符的各种编码方式懵懵懂懂,什么ANSI.UNICODE.UTF-8.GB2312.GBK.DBCS.UCS--是不是看的很晕,假如您细细的阅读本文你一定可以清晰的理解他们.Let's ...
- 修改Ubuntu12.04 左侧启动器Launcher图标大小,以及如何隐藏启动器?
在 VirtualBox 中安装了 Ubuntu 12,一直使用 2D 桌面,3D桌面没用上,估计是电脑配置低的问题. 左边启动器的图标特别大,占据了很多的桌面空间,打算调小点.奇怪的是,在“系统设置 ...
- Android Studio升级后,开启时遇到tools.jar seems to be not in Android Studio错误?
工作半年多,电子工程小白一枚.今天上班的时候,与几位同事聊到博客的问题.平时都是在别人的博客里找到问题的解决之妙法, 今天一个冲动之下,我决定也开始用博客记录工作的点滴,暂且当作笔记一用. 出于工作需 ...
- qstring与char*、基本数据类型的转换
1.qstring转化为char* QString.toStdString.c_str() 2.char*转化为QString str = QString(QLatin1String(mm)); 3. ...