让JRebel使用'mvn tomcat:run' [英] Getting JRebel to work with 'mvn tomcat:run'

查看:263
本文介绍了让JRebel使用'mvn tomcat:run'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道当我从命令行执行'mvn tomcat:run'时,是否有人能指出让JRebel工作的方向。我可以让JRebel在我的IDE(IntelliJ IDEA)中工作,但是在IDE内部运行感觉有点笨拙。当我运行测试时,我不喜欢在它旁边运行另一个进程 - 称之为习惯。

I was wondering if someone could point me in the direction of getting JRebel to work when I execute 'mvn tomcat:run' from the command line. I can get JRebel to work in my IDE (IntelliJ IDEA), but it feels a little clunky to be running inside of the IDE. When I run tests, I don't like having another process running right next to it - call it a habit.

不仅如此,我还有一些当我试用它时,服务器锁定JRebel ...我不希望IDE因此而挂起。我一直在手动终止这个过程,并且控制权被交还给IDEA ......但最好不要让它在IDEA中运行。

More than that though, I've been having some server lock ups with JRebel as I try it out... and I don't want IDE to hang as a result. I've been teminating the process manually, and control is given back to IDEA... but it would be better to not have it running in IDEA at all.

I我试过谷歌搜索这个,但我还没有找到如何将JRebel与tomcat插件合并。

I've tried googling this, but I haven't found how to incorporate JRebel with the tomcat plugin.

谢谢

推荐答案

没有设置MAVEN_OPTS系统变量帮助吗?

doesn't setting MAVEN_OPTS system variable help?

正好和示例:


  1. mvn archetype:generate -DgroupId = com.mycompany.app -DartifactId = my-webapp -DarchetypeArtifactId = maven-archetype-webapp

  2. cd my-webapp

  3. 到你的例子的pom.xml添加以下内容:


    < plugin>

      ; < groupId> org.zeroturnaround< / groupId>

      < artifactId> jrebel-maven-plugin< / artifactId>

      < executions>

       < execution>

        < id> generate-rebel-xml< / id>

        <阶段>流程资源< /阶段>

         < goals>

          < goal>生成< / goal>

         < / goals>

       < / execution>

      < / executions>

    < / plugin>


  4. 设置MAVEN_OPTS = -javaagent:/ path / to /jrebel.jar

  5. mvn tomcat:run

  1. mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-webapp -DarchetypeArtifactId=maven-archetype-webapp
  2. cd my-webapp
  3. to pom.xml of your example add the following:
    <plugin>
      <groupId>org.zeroturnaround</groupId>
      <artifactId>jrebel-maven-plugin</artifactId>
      <executions>
       <execution>
        <id>generate-rebel-xml</id>
        <phase>process-resources</phase>
         <goals>
          <goal>generate</goal>
         </goals>
       </execution>
      </executions>
    </plugin>
  4. set MAVEN_OPTS=-javaagent:/path/to/jrebel.jar
  5. mvn tomcat:run

在控制台中你将会看到来自JRebel的消息,如下所示:

In the console you'll see message from JRebel like these:

JRebel:将监视目录'C:\ project'\\ my-webapp \ target \classes'的变化。$
JRebel:将监控目录'C:\projects\my-webapp \src\main\webapp'的变化。

JRebel: Directory 'C:\projects\my-webapp\target\classes' will be monitored for changes.
JRebel: Directory 'C:\projects\my-webapp\src\main\webapp' will be monitored for changes.

这篇关于让JRebel使用'mvn tomcat:run'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆