Intellij Idea 4 ways to configure Hot deployment

Source: Internet
Author: User
Tags relative

A hot deployment allows you to load changed code after modifying the code without restarting the server.

1th: Modify the server configuration so that when the idea window loses focus, the class and resources are updated

Menu Run-editconfiguration, then configure the specified server under the Right Server tab under on frame deactivation = Update classes and resource.

Advantages: Simple

Disadvantage: The hot load based on the JVM only supports code modifications within the method block, only in debug mode, and when the idea loses focus, the heat loads and the relative loading speed is slow

2nd: Use the springloaded jar package A. Download the jar package, github:https://github.com/spring-projects/spring-loaded

B. Adding a VM startup parameter when you start an app:-javaagent:/home/lkqm/.m2/repository/org/springframework/springloaded/1.2.7.release/ Springloaded-1.2.7.release.jar-noverify

Pros: Support for the Spring Series framework (without spring boot), support for member-level modifications (Redaction methods, fields, annotations), support for enumeration set of values.

Cons: Relative to merit

3rd: Using the developer tools provided by Spring-boot-devtools

The following dependencies are introduced in the Spring-boot project

<dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId> Spring-boot-devtools</artifactid>
 </dependency>

Pros: Simple, support for spring-boot projects, support for member-level modification of hot deployments.

Cons: Only spring-boot projects are supported.

4th: Use the Jrebel plugin for hot deployment (14-day free trial of the plugin)

Online Installation: Menu file, Setting, Plugin, click on the bottom right of the Browse repositories, the top of the popup box input: jreble for Intellij, select Install.

Pros: Powerful, support for various frameworks, and the way to provide IDE plugins.

The last 3 methods are based on the class loading mechanism to implement the hot load, so you have to modify the completion code after the current code must be recompiled to trigger a hot deployment, Eclipse supports automatic compilation by default, and in IntelliJ idea, the default is to turn off automatic compilation, you can follow the following 2 steps to open: Idea Open Project Auto compile, go to Settings, Build,execut, Deployment, Compiler tick the Build project automatically idea on the left to turn on automatic make, CTRL + SHIFT + A SEARCH command: registry, tick Compiler.automake.allow.when.app.running

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.