大漠驼铃

置身浩瀚的沙漠,方向最为重要,希望此blog能向大漠驼铃一样,给我方向和指引。
Java,Php,Shell,Python,服务器运维,大数据,SEO, 网站开发、运维,云服务技术支持,IM服务供应商, FreeSwitch搭建,技术支持等. 技术讨论QQ群:428622099
随笔 - 238, 文章 - 3, 评论 - 117, 引用 - 0

导航

<2009年2月>
25262728293031
1234567
891011121314
15161718192021
22232425262728
1234567

公告

本博客提供技术讨论QQ群:428622099,希望志同道合的朋友加入群,共同进步和学习。
如果您觉得本博客还可以,请支持网页顶部的广告,谢谢。

常用链接

留言簿(11)

随笔分类(214)

随笔档案(239)

文章分类(1)

文章档案(1)

相册

作品

  • 北京韦尔科技有限公司
  • 北京韦尔科技有限公司是一家从事互联网相关技术研发型的公司,对外提供互联网相关技术培训,产品研发等。
  • 映目图文直播官网
  • 图文直播-让直播更简单更有效。图文直播基于文字、图片、视频的直播方式,直播可嵌入APP、网站和微信公众平台,提供多种方式面向企业个人支持在线直播云服务、远程部署服务、技术支持服务!
  • 映目官网
  • 映目是一体化自助式全流程的数字会议云平台,拥有直播、活动、签到、互动、会务、云摄影子产品,提供线上线下一体化服务,包含会议网站、签到、互动、直播、数据统计、摄影、摄像、速记、翻译等全流程的线上线下解决方案,办活动找映目,高效率、高质量、低成本,映目让会议活动举办更简单。
  • 映目照片直播官网
  • 映目照片直播,专业的照片直播、图片直播、云摄影商业纪实摄影服务供应商,5秒数快传、3分钟快修即刻呈现,全国拍摄发布会、庆典、年会、展览、活动、沙龙、派对、讲座、课程、会议、文化演出、体育赛事等活动

搜索

  •  

积分与排名

  • 积分 - 670141
  • 排名 - 69

最新评论

阅读排行榜

评论排行榜

maven 中使用jetty原始文章

Apache Wicket
Maven Jetty plugin
Added by Martin Funk, last edited by Adam Mathias Bittlingmayer on Jan 09, 2008  (view change)

Using the Maven Jetty plugin

This note is to describe the above plugin. which will run your web application in an embedded Jetty6 instance by just
typing "mvn jetty:run" - No need to download or install Jetty manually, it's all automatic once the Maven project
descriptor's set up (the pom.xml)

Configuring HowTo

Add the following to the <build><plugins> block of your projects pom.xml

<plugin>



<groupId>org.mortbay.jetty</groupId>



<artifactId>maven-jetty-plugin</artifactId>



</plugin>

Running

In order to run Jetty on a webapp project which is structured according to the usual Maven defaults, you don't need to configure anything.

Simply type:

mvn jetty:run

Due to a bug in maven or the maven-jetty-plugin this only works if no jetty artifact is present in the dependencies section of the pom.xml file. This is the case for wicket-quickstart, wicket-examples and wicket-threadtest. So the tips given here can't be applied to those projects.

Running the webapp in debug mode using Java Platform Debugger Architecture (JPDA)

Using maven command line:

I couldn't find a command line reference for maven2, but the one given for maven1 still aplies for the feature used here:

First set MAVEN_OPTS environment variable with the following command:

export MAVEN_OPTS='-Xdebug -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=y'

After setting this property, run "maven jetty:run" and it will block, waiting for a debug connection. If "suspend=n" is set, it will start right away.

Using eclipse external tools:

Running Eclipse Open "Run --> External Tools --> External Tools... --> Program". Press "New launch configuration". On the "Main" tab, fill in the "Location:" as the full path to your "mvn" executable. For the "Working Directory:" select the workspace that matches your webapp. For "Arguments:" add jetty:run.

Move to the "Environment" tab and click the "New" button to add two new variables:

name value
MAVEN_OPTS -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=y
JAVA_HOME Path to your java executable

As above the jvm will start right away when "suspend=n" is set.

Attaching to the server running in debug mode, using eclipse:

Running Eclipse Open "Run --> Debug... --> Remote Java Application". Press "New launch configuration". Fill in the dialog by selecting your webapp project for the "Project:" field, and ensure you are using the same port number as you specified in the address= property above.

Now all you need to do is Run/Debug and select the name of the debug setup you setup above.

This article is a gathering of information, credits need to be given to the authors of the pages behind the given links.


 Eclipse中用Maven来启动Jetty调试Web应用

1、先来配置一个外部工具,来运行JETTY:
 选择菜单Run->External Tools->External Tools ...在左边选择Program,再点New:
 配置Location为mvn完整命令行。定位到bin下的mvn.bat
 选择Working Directory为本项目。
 Arguments填写:jetty:run
 再点选Enviroment页:加入MAVEN_OPTS变量,值为:
 -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8080,server=y,suspend=y
 其中,如果suspend=n 表示不调试,直接运行。address=8080为端口
 然后,点APPLY,点击Run启动jetty
 
2、调试应用
 点选run->debug...
 选中左树中的Remote Java Application,再点New。
 选择你的项目,关键是要填和之前设置外部工具时相同的端口号,其它都不变。
 
注意:停止调试后,8080端口并没有关闭,再运行run->debug后会报错,具体原因没有去深究。建议采用TcpView等工具关闭对应端口的进程

posted on 2009-02-14 17:37 草原上的骆驼 阅读(1288) 评论(0)  编辑  收藏 所属分类: 项目管理


只有注册用户登录后才能发表评论。


网站导航: