Eclipse Maven jetty整合
来源:互联网 发布:液晶电视k歌软件 编辑:程序博客网 时间:2024/06/09 12:51
公司使用maven构建项目,之前并没有在项目中实际用到maven,因此需要重新搭建开发环境,记录下来过程:
1.右键项目debug as添加mvn命令: jetty:run
2.进入eclipse的菜单Run->Debug configurations,会看到maven build下对应的项目的mvn命令的项,选中Environment选项卡 -->New,name输入MAVEN_OPTS,value中加入-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=y
3.项目右键Debug as-->Maven build(刚才设置的mvn命令)
maven下 jetty:run很爽,但是偶尔想通过eclipse调式一下可以吗?
回答是肯定的
Goals还是设置为jetty:run
Environment添加variable
name:MAVEN_OPTS
variable:-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
然后eclipse debug,跟以前一样调试有木有
以上转自:http://www.spasvo.com/ceshi/open/kydycsgj/junit/2013121293531.html
实际上最新的Eclipse只需第一步即可在开发环境中使用maven
按照上面的步骤进行操作可以使用jetty 启动项目,并且可以debug,实现热部署。
以下为pom中相关的插件信息
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.25</version>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
<stopKey>foo</stopKey>
<stopPort>9999</stopPort>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>80</port>
</connector>
</connectors>
<webAppConfig>
<contextPath>/</contextPath>
</webAppConfig>
</configuration>
<executions>
<execution>
<id>start-jetty</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<scanIntervalSeconds>0</scanIntervalSeconds>
<daemon>true</daemon>
</configuration>
</execution>
<execution>
<id>stop-jetty</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
- Eclipse Maven jetty整合
- jetty eclipse 整合一
- jetty eclipse 整合二
- jetty eclipse 整合三
- jetty与eclipse整合
- Eclipse+maven+jetty测试
- Eclipse Maven Jetty集成
- Maven + eclipse + jetty
- eclipse+jetty+Maven
- Eclipse Maven Jetty集成
- Eclipse+maven+jetty
- eclipse maven jetty调试方式
- eclipse maven jetty调试方式
- eclipse maven jetty 热部署
- eclipse-maven插件jetty使用
- maven jetty的eclipse 插件
- Eclipse中调试Maven+Jetty
- eclipse+jetty+maven 启动异常
- android 电容屏(二):驱动调试之基本概念篇
- Android MediaPlayer使用注意
- windows环境下lib和dll的区别和联系详细
- Android----优化XML的智能提示
- Detour的使用
- Eclipse Maven jetty整合
- 在docker上安装 Spark 1.2.0
- 怎么查看SQL Server 补丁版本
- Windows系统OpenCV之安装和环境变量配置
- Slimframework 上手日记
- vim/vi编码问题
- LeetCode 128. Longest Consecutive Sequence(nlogn)
- 多线程同步 -(C++)主要函数
- SVN:Myeclipse安装svn插件肯定可行的方法