Mac 下 Intellij IDEA 2016.1.2+maven+jetty+ JRebel 6.4.3 破解+spring mvc

准备阶段: 

  •  Intellij IDEA 2016.1.2 (官方下载,作者下载的是社区版); 
  •  JRebel for IntelliJ插件安装,可选择在线安装,在线安装的是最新版,我选择本地安装,
  • 下载插件地址:http://plugins.jetbrains.com/plugin/download?pr=&updateId=25523   
  •  网盘下载链接: http://pan.baidu.com/s/1nuT1Jlf 密码: e2mm
  • JRebel 6.4.3(IDEA plugins中 选择JRebel 下载,也可以在JRebel官方自行下载); 
  • 破解补丁​链接: http://pan.baidu.com/s/1hr9tgwO 密码: snvr 

 开始破解: 

  1. 关闭Intellij IDEA 
  2. 解压补丁,替换jar包与licence文件 ​
  • 将本机 /Users/<你的用户名>/.jrebel/jrebel.lic替换为下载的jrebel.lic; 

    3. 将补丁解压包里的文件分别覆盖一下文件,注意文件夹的名字哦。 

  • /Users/<你的用户名>/Library/Application Support/IdeaIC2016.1/jr-ide-idea/lib/jrebel6/jrebel.jar
  • /Users/<你的用户名>/Library/Application Support/IdeaIC2016.1/jr-ide-idea/lib/jrebel/jrebel.jar 

最后重启IDEA 即可

注意:JRebel只支持spring 4.2.7以下的版本,否则会报错:

JRebel: ERROR Class 'org.springframework.core.io.support.PathMatchingResourcePatternResolver' could not be processed by org.zeroturnaround.javarebel.integration.spring.core.cbp.PathMatchingResourcePatternResolverCBP@org.apache.catalina.loader.WebappClassLoader@6ae1912a: org.zeroturnaround.bundled.javassist.CannotCompileException: [source error] getURL() not found in java.net.URL

Jetty 总是重启动的问题:
            <plugin>
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>8.1.16.v20140903</version>
                <configuration>
                    <!-- jetty 热部署
                    当修改了java文件时,在IntelliJ中按:‘Ctrl+Shift+F9’ 将重新编译该java文件,
	                如果修改了多个java文件,按‘Ctrl+F9’ 可以重新编译整个工程。
                    <scanIntervalSeconds>1</scanIntervalSeconds>
                    -->
                    <stopPort>9988</stopPort>
                    <stopKey>foo</stopKey>
                    <!--
                    <reload>automatic</reload>
                    <scanIntervalSeconds>5</scanIntervalSeconds>
                    -->
                    <connectors>
                        <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
                            <port>8080</port>
                            <maxIdleTime>60000</maxIdleTime>
                        </connector>
                    </connectors>
                    <webAppConfig>
                        <contextPath>/</contextPath>
                    </webAppConfig>
                </configuration>
            </plugin>

  

关闭自动发现扫描:
<!--
 <reload>automatic</reload>
 <scanIntervalSeconds>5</scanIntervalSeconds>
-->
 
原文地址:https://www.cnblogs.com/jifeng/p/5894420.html