在Spring Boot devtools 1.3中遇到新的LiveReload功能问题。它不会重新加载类更改。我已经看到它与IntelliJ @ Devoxx 2015 demo'd。有一些IDE设置我需要启用?我通过IDE运行,而不是通过Gradle。我尝试启用“自动生成项目”,这似乎没有帮助。IntelliJ 15,SpringBoot devtools livereload不起作用
它似乎正确加载,并期待在正确的路径
2015-11-23 05:55:30.592 DEBUG 4700 --- [ restartedMain] o.s.boot.devtools.restart.Restarter : Starting application com.myapp.Application with URLs [file:/E:/Projects/myapp/build/classes/main/, file:/E:/Projects/myapp/build/resources/main/]
我的文件
的build.gradle
buildscript {
ext {
springBootVersion = '1.3.0.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse-wtp'
apply plugin: 'idea'
apply plugin: 'spring-boot'
apply plugin: 'war'
war {
baseName = 'myapp'
version = '0.0.1-SNAPSHOT'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
}
configurations {
providedRuntime
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-actuator')
compile('org.springframework.boot:spring-boot-devtools')
compile('org.springframework.boot:spring-boot-starter-jdbc')
compile('org.projectlombok:lombok')
compile('org.springframework.boot:spring-boot-starter-web')
compile('net.sourceforge.jtds:jtds:1.3.1');
testCompile('org.springframework.boot:spring-boot-starter-test')
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-starter-parent:Brixton.M3"
}
}
eclipse {
classpath {
containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER')
containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8'
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.7'
}
HelloWorldController
@Controller
public class HelloWorldController {
@RequestMapping("/")
@ResponseBody
String home(){
return "Hello World test";
}
}
试图了解以下“的IntelliJ用户需要卸妆使用生成→使项目采取行动,以实现同样的结果。“也许这是为了说“记住”而不是“卸妆”?你们是否设置了一个宏或什么东西来自动完成你的项目?只有当应用程序没有运行时,IntelliJ才支持这个功能......我见过其他人需要创建一个宏并将其与“CTRL + S”操作绑定。 –
这是一个错误,[已经固定在master上](http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#using-boot-devtools-restart)。使项目只是一个捷径。如果你觉得“CTRL-S”对你更好,那么做。但它基本上是完全一样的东西。我真的不买“自动制造”的方法,但那可能就是我。 –
好吧,但静态资产呢。为什么我需要为他们调用Build? – Kaspar