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

2017-09-21 19:58:01 +08:00
 esolve

根据此文 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.

2052 次点击
所在节点    问与答
5 条回复
wzdbsss
2017-09-21 20:04:30 +08:00
这个热加载是新增类后都能热加载?
uxstone
2017-09-21 21:08:13 +08:00
debug 启动才能热加载吧 ....
z742364692
2017-09-22 01:41:20 +08:00
都是可以热加载的,风扇噪音巨大,遂关之
esolve
2017-09-22 10:13:14 +08:00
@wzdbsss 修改 新增应该都可以
jack80342
2017-10-31 21:53:53 +08:00
这几天刚刚翻译了 Spring Boot 最新的官方文档,欢迎👏fork,https://www.gitbook.com/book/jack80342/spring-boot/details

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/392641

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX