Spring boot-Hot Deployment and Debugger use (iii)

Source: Internet
Author: User

Hot deployment

1. Add a hot deployment pom dependency

<!--Hot Deployment plug-in dependent jar package -        <Dependency>            <groupId>Org.springframework.boot</groupId>            <Artifactid>Spring-boot-devtools</Artifactid>            <Optional>True</Optional>        </Dependency>

2. Added in Maven plugin

<plugin>                <groupId>Org.springframework.boot</groupId>                <Artifactid>Spring-boot-maven-plugin</Artifactid>                <configuration> <fork>true</fork> </configuration>                        <dependencies> <!--Spring Hot deployment plug-in <dependency> <groupId>org.springframework</groupId> <artifactid>springloaded</a                Rtifactid> <version>1.2.6.RELEASE</version> </dependency> </dependencies>            </plugin>

3.idea turn on auto-compile

File=>settings under

4. Key combination: shift+alt+ctrl+/, select "Registry", enter, find "complier.automake.allow.when.app.running" tick

5. Running with the MAVEN command will be automatically compiled and deployed

Debuger

We use the MAVEN command to debug and we find that we can't get in.

1. Add Configuration in Maven plugin

<plugin>                <groupId>Org.springframework.boot</groupId>                <Artifactid>Spring-boot-maven-plugin</Artifactid>                <Configuration>                    <Fork>True</Fork>                   <jvmArguments>-xdebug-xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8088 </jvmArguments>                </Configuration>               <executions> <execution> <goals>                <goal>repackage</goal> </goals> </execution> </executions>                <Dependencies>                    <!--Spring Hot Deployment plug-in -                    <Dependency>                        <groupId>Org.springframework</groupId>                        <Artifactid>springloaded</Artifactid>                        <version>1.2.6.RELEASE</version>                    </Dependency>                </Dependencies>            </plugin>

Address is your debug listening port, do not repeat with project Port

2. Add Remote

Port to above tells Maven the listening port

4. Start the project

5. Debug mode to start remote

6 test the code with a breakpoint can be found to enter the breakpoint.

Note: Not only for development environments, but also for local code debugging if the project is published to a line

Spring boot-Hot Deployment and Debugger use (iii)

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.