在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