基于maven tomcat插件的项目热部署

1 安装下载jrebel插件(如何**见收藏)

  • myeclipse----help-----eclipse marketplace搜jrebel然后安装
  • 基于maven tomcat插件的项目热部署
  • **见收藏

2 如何实现

  • 在maven项目pom添加tomcat插件及热部署jrebel插件
<plugin>
            <groupId>org.apache.tomcat.maven</groupId>
            <artifactId>tomcat7-maven-plugin</artifactId>
            <version>2.2</version>
            <configuration>
                <port>80</port>
                <path>/</path>
            </configuration>

        </plugin>

        <!-- jrebel热部署插件 -->
        <plugin>
            <groupId>org.zeroturnaround</groupId>
            <artifactId>jrebel-maven-plugin</artifactId>
            <version>1.1.8</version>
            <executions>
                <execution>
                    <id>generate-rebel-xml</id>
                    <phase>process-resources</phase>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

  • 选中项目,点击右键–>JRebel–>Enable JRebel会在项目的src/main/resources目录下自动生成rebel.xml配置文件
  • 点击右键Run As -> Run configuration…
  • 在对话框找到JRebel选项中勾选Enable JRebel agent
    基于maven tomcat插件的项目热部署