Getting JRebel to work with 'mvn tomcat:run'

前端 未结 3 750
囚心锁ツ
囚心锁ツ 2020-12-29 09:34

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

3条回答
  •  清歌不尽
    2020-12-29 10:15

    doesn't setting MAVEN_OPTS system variable help?

    Just and example:

    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:

        org.zeroturnaround
        jrebel-maven-plugin
       
        
          generate-rebel-xml
          process-resources
          
            generate
          

        

       


    4. set MAVEN_OPTS=-javaagent:/path/to/jrebel.jar
    5. mvn tomcat:run

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

    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.

提交回复
热议问题