IntelliJ 15,SpringBoot devtools livereload无法正常工作 [英] IntelliJ 15, SpringBoot devtools livereload not working

查看:258
本文介绍了IntelliJ 15,SpringBoot devtools livereload无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Spring Boot devtools 1.3解决了新的LiveReload功能问题。它不会在类更改时重新加载。我已经看到它使用IntelliJ @ Devoxx 2015演示了。我需要启用一些IDE设置吗?我正在通过IDE而不是通过Gradle运行。我尝试启用自动生成项目,这似乎没有帮助。

Having issues with the new LiveReload feature with Spring Boot devtools 1.3. It doesn't reload on class changes. I've seen it demo'd with IntelliJ @ Devoxx 2015. Is there some IDE setting I need to have enabled? I'm running via the IDE and not through Gradle. I tried enabling "Make project automatically" which doesn't seem to help.

它似乎正确加载并正在查找正确的路径

It seems to load correctly and is looking in the correct path

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

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

HelloWorldController

@Controller
public class HelloWorldController {

    @RequestMapping("/")
    @ResponseBody
    String home(){

        return "Hello World test";
    }
}


推荐答案

我我猜你正在编码,并期望DevTools自动神奇地发现你已经改变了你项目中的东西? Devtools通过观察你的classpath文件夹来做到这一点。当 .class 文件(或资源)发生变化时,devtools会采取适当的行动。

I am guessing you are coding and expect DevTools to auto-magically figure out you have changed something in your project? Devtools does that by watching your classpath folder(s). When a .class file (or a resource) has changed, devtools take the appopriate action.

如果你不喜欢看不到任何东西,这可能是因为你只是编码而不是更新类路径。您必须调用 Make Project 来更新类路径。请参阅文档

If you don't see anything, that's probably because you're just coding and not updating the classpath. You have to invoke Make Project to update the classpath. See the documentation

这篇关于IntelliJ 15,SpringBoot devtools livereload无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆