当前位置:首页 > 开发 > 编程语言 > JDK JVM > 正文

maven run-jetty-run jrebel

发表于: 2013-06-19   作者:blackstreet   来源:转载   浏览:
摘要: maven加google的run-jetty-run插件 加上jrebel解决开发web项目重启问题 1.下载附件中jreble并解压到本地如 2:run-jetyy-run的eclispe在线下载 http://run-jetty-run.googlecode.com/svn/trunk/updatesite 选择RunJettyRun这样就行,还有一个RunJetyyRun
maven加google的run-jetty-run插件 加上jrebel解决开发web项目重启问题


1.下载附件中jreble并解压到本地如

2:run-jetyy-run的eclispe在线下载
http://run-jetty-run.googlecode.com/svn/trunk/updatesite
选择RunJettyRun这样就行,还有一个RunJetyyRun1.3不用选
在maven的web工程上右击debug as -> Debug configuration...
新建一个jetty webapp
自己根据情况选择jetty的版本,现支持jetty6到8
Project port 选项自己看着办

3.安jrebel插件
http://update.zeroturnaround.com/update-site
安装时我只选择了第一个选项Jrebel for Eclilpse(3.3+)

4.选上面的Arguaments选项卡,这里是配置jvm参数的地方,在VM arguments处加上
-noverify 
-javaagent:F:/jrebel.jar(根据自己的路径修改)

一切OK,点Debug运行
控制台信息 会有
[2013-06-19 14:08:47]  JRebel 5.1.2 (201212171004)
[2013-06-19 14:08:47]  (c) Copyright ZeroTurnaround OU, Estonia, Tartu.
[2013-06-19 14:08:47]
[2013-06-19 14:08:47]  Over the last 30 days JRebel prevented
[2013-06-19 14:08:47]  at least 36 redeploys/restarts saving you about 1.5 hours.
[2013-06-19 14:08:47]
[2013-06-19 14:08:47]  Over the last 64 days JRebel prevented
[2013-06-19 14:08:47]  at least 69 redeploys/restarts saving you about 2.8 hours.
[2013-06-19 14:08:47]
[2013-06-19 14:08:47]  You are running with an evaluation license.
[2013-06-19 14:08:47]  You have 31631 days until the license expires.
2013-06-19 14:08:47.790:INFO::Logging to STDERR via org.mortbay.log.StdErrLog
ParentLoaderPriority enabled
Context path:/pic-web
ProjectClassLoader: entry=D:\workspace-sts\pic-web\target\classes
。。。。。。。。。。。。。。。。。。。。。等等
[2013-06-19 14:08:48] JRebel: Directory 'D:\workspace-sts\pic-web\target\classes' will be monitored for changes.
[2013-06-19 14:08:48] JRebel: Directory 'D:\workspace-sts\pic-web\target\m2e-wtp\web-resources' will be monitored for changes.
[2013-06-19 14:08:48] JRebel: Directory 'D:\workspace-sts\pic-web\src\main\webapp' will be monitored for changes.
[2013-06-19 14:08:48] JRebel: Directory 'D:\workspace-sts\pic-action\target\classes' will be monitored for changes.
[2013-06-19 14:08:48] JRebel: Directory 'D:\workspace-sts\pic-service\target\classes' will be monitored for changes.
[2013-06-19 14:08:48] JRebel: Directory 'D:\workspace-sts\pic-domain\target\classes' will be monitored for changes.
[2013-06-19 14:08:48] JRebel: Directory 'D:\workspace-sts\pic-util\target\classes' will be monitored for changes.
[2013-06-19 14:08:48] JRebel: Directory 'D:\workspace-sts\pic-sdk\target\classes' will be monitored for changes.
[2013-06-19 14:08:48] JRebel-Log4j: Monitoring Log4j configuration in 'file:/D:/workspace-sts/pic-web/target/classes/log4j.properties'.

这样就没问题
你会发现每个maven工程的src/main/resources会有rebel.xml文件,
大概就监视rebel.xml中这个目录下文件修改

maven run-jetty-run jrebel

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号