Use Jrebel for Project hot deployment in Eclipse (Maven plug-in version)

Source: Internet
Author: User
Tags maven central aliyun

Jrebel implementing a Project Hot Deployment (Maven plugin version)

A hot deployment is a direct software upgrade that does not restart during application operation.

During the development process, a hot deployment is the code that changes as the project runs, and the code takes effect without restarting the server.

Tomcat can make a project hot deployment, but it cannot be thermally deployed when adding methods or method name changes to a class, requiring a restart of the server, resulting in a lot of wasted development time waiting for the project to restart, with Jrebel enabling the most project code churn to be hot-deployed.

Before installing the Jrebel plug-in, it is recommended that the Maven Jar Central Warehouse (the default is foreign, the download speed is relatively slow) for domestic, it is recommended to set up as Ali's central warehouse.

MAVEN Central Warehouse Replacement steps:

① Changing the MAVEN configuration file

② setting up the MAVEN configuration file to eclipse

1. Locate the local MAVEN installation path, Open Local conf/settings.xml under Maven installation path:

2. Add the following image parameters to the <mirrors></mirrors> tab and Save:

<mirror>    <id>alimaven</id>    <name>aliyun maven</name>    <url>http ://maven.aliyun.com/nexus/content/groups/public/</url>    <mirrorOf>central</mirrorOf>        </mirror>

3. Open Eclipse-->window-->preferences and find the user Settings under Maven:

-------------------------------------------------Step End-------------------------------------------------------------

Installing the Jrebel plugin in Eclipse :

After waiting for the installation to complete, click OK to restart the Eclipse dialog box when it pops up, wait for the automatic restart of Eclipse, the plug-in installation is complete.

Plugin activation Please refer to: 76422807

-------------------------------------------------Step End--------------------------------------------------

I am developing a project that uses Tomcat as the Tomcat plugin for MAVEN, so I need to add Maven's Tomcat plugin to run the project through MAVEN's Tomcat plugin to use Jrebel to add Maven's Jrebel plugin.

MAVEN's Tomcat plugin with Jrebel setup steps:

1. Add the Tomcat plugin and the Jrebel plugin in the <plugins> tab of the Pom.xml <build></build> tab:

Here is the plugin code:

<!--Maven's Tomcat component to run the project--><plugin> with maven command Tomcat7:run <groupid>org.apache.tomcat.maven</ Groupid> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.2</version> < configuration> <port>8080</port> <path>/Irritability</path> </configuration>< /plugin><!--Jrebel Hot Deployment plug-in--><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>

2. Select the item and right-click-->jrebel-->enable JRebel will automatically generate the Rebel.xml profile in the project's Src/main/resources directory:

3. Select Item Right click-->run As-->maven build ...:

Follow the steps in the diagram and then click the Run button to run the project:

Running results: If the Jrebel plugin is successful, then Tomcat starts:

When you save your code after you start to rename a method within a project, Jrebel automatically detects code changes and recompile the file that changed the code, and the console prints the information:

Add: I run the project to start normally after completing the Jrebel installation, but appear when I click on the request

Exception in Thread "" http-bio-80 "exec-1" Java.lang.OutOfMemoryError:PermGen s exception (memory overflow).

The memory overflow workaround is to expand the set of memory by following these steps:

windows-->preferences-->java-->installed JREs Right-->edit ...

Write-xms512m-xmx1024m-xx:permsize=256m-xx:maxpermsize=768m in Default VM arguments

, and then restart the project to use the Jrebel thermal deployment project normally.

Sometimes modifying code Jrebel does not automatically deploy automatically may not be checked for automatic compilation

Use Jrebel for Project hot deployment in Eclipse (Maven plug-in version)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.