×

jrebel

IDEA+ jrebel+maven多模块项目热部署真实可用,100%

我的笔记 我的笔记 发表于2020-09-18 15:09:20 浏览3807 评论0

抢沙发发表评论

1、复制代码到最大的pom.xmlplugins标签下,多模块工程需要有这一步,非多模块工程不需要

<plugin>
    <groupId>org.zeroturnaround</groupId>
    <artifactId>jrebel-maven-plugin</artifactId>
    <version>1.1.8</version>
    <configuration>
        <!-- 将配置的资源目录也添加到rebel.xml-->
        <addResourcesDirToRebelXml>true</addResourcesDirToRebelXml>
        <!--如果设置为true,则生成的rebel.xml将在构建期间在控制台中打印出来,可以立即看到生成的内容。默认为false-->
        <showGenerated>true</showGenerated>
        <!-- 每次都生成新的rebel.xml。如果为false,只在rebel.xmlpom.xml的时间戳不相同的时候,重新生成rebel.xml。默认为false -->
        <!--<alwaysGenerate>true</alwaysGenerate>-->
        <!-- 在单个项目中处理多个模块时,您可以选择跳过为特定模块生成rebel.xml。 只需将以下内容添加到他们的pom.xml中即可 -->
        <!--<skip>true</skip>-->
        <!-- 如果工程师自己自定义的package,则需要主动设置为 jar 或者 war -->
        <!--<packaging>war</packaging>-->
    </configuration>
    <executions>
        <execution>
            <id>generate-rebel-xml</id>
            <phase>process-resources</phase>
            <goals>
                <goal>generate</goal>
            </goals>
        </execution>
    </executions>
</plugin>

 

 

2、先安装插件,点击菜单栏File->Settings->Plugins

wps2.jpg 

3、搜索Jrebel

wps3.jpg 

4、重启

5、进去Settings,有个新选项Jrebel & XRebel

wps4.jpg 

6、验证,如图

https://www.zpjeck.top/jrebel/518dc87d-b942-4369-a635-323cfc81d0e1

wps5.jpg 

7、配置项目,File->Project Structure,选择Project选项卡,编译输出目录选择run模块的targer目录

 

wps6.jpg

8、配置tomcat

wps7.jpg 

wps8.jpg 

9、配置自动编译,进入File->Settings->Build,Execution...->Compiler

wps9.jpg 

10、最后点击Jerebel Debug启动,

wps10.jpg 

11、每次改动代码后Ctrl+Shift+F9,提示reloaded

wps11.jpg 

 

 


我的笔记博客版权我的笔记博客版权