在 Java Web 开发中, 一般更新了 Java 文件后要手动重启 Tomcat 服务器, 才能生效, 浪费不少生命啊, 自从有了 JRebel 这神器的出现,
不论是更新 class 类还是更新 Spring 配置文件都能做到立马生效,大大提高开发效率。
传统方法在RunConfirguation上面On Update action
配置参数,浪费生命。
【安装JRebel】
激活方法:http://blog.csdn.net/gsls200808/article/details/78785352
破解人:http://blog.lanyus.com/archives/317.html
官方的quickStart教程:https://zeroturnaround.com/software/jrebel/quickstart/intellij/#!/server-configuration
破解步骤
1.mvn clean
2.mvn compile
3.mvn exec:java -Dexec.mainClass="com.vvvtimes.server.MainServer"
验证:http://localhost:8081/
4.默认反代idea.lanyus.com, 运行起来后, http://127.0.0.1:8081/JRebel用户名 就是激活地址了, 邮箱随意填写.
https://www.qvdv.com/tools/guid.html
【安装MybatisPLUS】
破解人:https://shawnho.me/2017/12/20/ideaagent/
下载https://github.com/mrshawnho/ideaagent
官方的quickStart教程:https://www.codesmagic.com/mybatisplugin/userguide/run-generator
【使用JRebel】
特别需要注意的是 On 'Update' action
和On frame deactivation
这两项目一定要选择 Update classes and resources
, 否则类修改热部署不生效, 或者第三方模版框架例如 Freemarker 热部署不生效
还可以通过ToolWindow打开侧边栏,添加到Facets,jrebel.xml,然后支持用MAVEN构建工具启动(即MavenProject右键debug Jrebel...)
【实时编译】
settings => 搜索 compiler 找到 build project automatically
【解决 spring auto-scan ,mybatis 找不到 bean 问题】
settings => 搜索 inspections spring core => autowiring for bean class 降低到 warnings。