我在使用Spring开发工具和Eclipse时也遇到过类似的情况。我遵循了本文中描述的配置,但是热重新加载不起作用。知道我错过了什么吗?这将是一个非常酷的功能。
编辑。Hot reload =任何类路径文件的更改都会自动触发应用程序重启。
我的Gradle构建脚本是:buildscript {
ext {
springBootVersion = '1.3.0.M4'
}
repositories {
maven { url "http://repo.spring.io/snapshot" }
maven { url "http://repo.spring.io/milestone" }
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath("io.spring.gradle:dependency-management-plugin:0.5.2.RELEASE")
}
}
和依赖关系:
dependencies {
compile("org.springframework.boot:spring-boot-devtools")
compile("org.springframework.boot:spring-boot-starter-data-jpa")
compile("org.springframework.boot:spring-boot-starter-freemarker")
compile("org.springframework.boot:spring-boot-starter-hateoas")
compile("org.springframework.boot:spring-boot-starter-jdbc")
compile("org.springframework.boot:spring-boot-starter-jersey")
compile("org.springframework.boot:spring-boot-starter-web")
runtime("com.h2database:h2")
runtime("mysql:mysql-connector-java")
testCompile("org.springframework.boot:spring-boot-starter-test")}
我找到了一个解决方案。由于某些原因,Eclipse仍然尝试使用以前的Spring Boot版本(1.2.5),在我删除并重新导入到项目后,热重新加载开始工作。