esolve
V2EX  ›  问与答

有人用过 springboot 的开发热加载吗?

  •  
  •   esolve · Sep 21, 2017 · 2903 views
    This topic created in 3341 days ago, the information mentioned may be changed or developed.

    根据此文 http://www.jb51.net/article/112473.htm 在 pom 文件中加入

            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <dependencies>
                    <dependency>
                        <groupId>org.springframework</groupId>
                        <artifactId>springloaded</artifactId>
                        <version>1.2.6.RELEASE</version>
                    </dependency>
                </dependencies>
            </plugin>
    

    然后想实现热加载

    可是很容易出现端口号被占用的状况,而且即使有时候没出现这种状况,也没能够热加载

    我仔细的在每次启动前把占用端口号的进程关掉,确保没有进程使用该端口再启动的

    Failed to start end point associated with ProtocolHandler [http-nio-8001]

    java.net.BindException: Address already in use: bind

    The Tomcat connector configured to listen on port 8001 failed to start. The port may already be in use or the connector may be misconfigured.

    5 replies  •  2017-10-31 21:53:53 +08:00
    wzdbsss
    wzdbsss
    Sep 21, 2017 via Android
    1
    这个热加载是新增类后都能热加载?
    uxstone
    uxstone
    Sep 21, 2017
    2
    debug 启动才能热加载吧 ....
    z742364692
    z742364692
    Sep 22, 2017 via iPhone
    3
    都是可以热加载的,风扇噪音巨大,遂关之
    esolve
    esolve
    OP
    Sep 22, 2017
    4
    @wzdbsss 修改 新增应该都可以
    jack80342
    jack80342
    Oct 31, 2017
    5
    这几天刚刚翻译了 Spring Boot 最新的官方文档,欢迎👏fork,https://www.gitbook.com/book/jack80342/spring-boot/details
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1131 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 23:59 · PVG 07:59 · LAX 15:59 · JFK 18:59
    ♥ Do have faith in what you're doing.