(转)利用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 ...
随机推荐
- LoadScript
function loadScripts(urls, callback) { if (typeof (urls) === "string"){ urls = [urls]; } v ...
- PHP7的安装
PHP7和HHVM比较PHP7的在真实场景的性能确实已经和HHVM相当, 在一些场景甚至超过了HHVM.HHVM的运维复杂, 是多线程模型, 这就代表着如果一个线程导致crash了, 那么整个服务就挂 ...
- QT读写ini配置文件
/********下面是写ini文件*************************/ //Qt中使用QSettings类读写ini文件 //QSettings构造函数的第一 ...
- 如何快速有效的修改java的环境变量
之前已经修改过jdk的环境变量,,,,在/etc/profile下,,, export JAVA_HOME=/usr/java/jdk1.7.0_67-cloudera export PATH=${J ...
- editplus如何配置php编译环境?
为什么要配置php编译? 因为,要先看看 php文件是否能够 编译得过去, 有没有错误, 如果有错误, 不能通过编译, 则肯定不能运行. 所以, 可以先看一下编译 得不得行. 在preferences ...
- ExtJS -- Grid 文本居中显示
Reference: http://stackoverflow.com/questions/6561120/extjs-4-apply-defaults-to-all-columns-in-a-gri ...
- Stm32 debug停留在"BKPT 0xAB"或者"SWI 0xAB"的解决办法。
一..背景: 曾经在工作中接触过STM32一段时间,但没有深入的去学习,只是用前辈搭建好的模型来实现一些功能罢了,俗话说的好,大树底下好乘凉,开发确实轻松了,可是不深究点,又觉着心里不踏实,然而也一直 ...
- 微信将推指纹支付 "指付通"会与Touch ID整合吗
有消息称微信下一版本将推指纹支付“指付通”,解决手机丢失资金安全的问题(这个应该是针对阿里手机支付的弱点),到时候用户绑定的银行卡进行付款时,不用输入密码只需在专门的支付设备(苹果Touch ID ? ...
- Java中将unix时间戳转化为正常显示时间
在unix中时间戳是一串数字表示的,使用起来非常不方便,转化方式如下: //Convert Unix timestamp to normal date style public String Time ...
- 【C语言入门教程】2.1 数据类型(5种基本数据类型),聚合类型与修饰符
C语言有5种基本的数据类型,分别为 字符型.整型.单精度浮点型.双精度浮点型.空类型. 在不同的操作系统或硬件平台中,这些数据类型的值域范围和所占用的内存是有差异的.这种差异影响了C语言的可移植性能, ...