Я создал проект Spring Boot Gradle, в котором используется Thymeleaf. Моя IDE - IntelliJ. Я создал application.properties в корневой папке с:Как включить Thymeleaf Live Reloading в Spring Boot 1.3
spring.resources.cache-period=0
spring.thymeleaf.cache=false
spring.thymeleaf.mode=LEGACYHTML5
Но почему-то до сих пор не авто-обновление. Сначала я должен нажать кнопку «Сделать проект». У меня есть другой проект с той же конфигурацией (не уверен в настройках IntelliJ), что, как ни странно, работает над обновлением.
Мое приложение application.properties считывается, так как я могу вытащить пользовательское свойство, используя аннотацию @Value.
Для справки, мой build.gradle
buildscript {
ext {
springBootVersion = '1.3.1.RELEASE'
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath("org.springframework:springloaded:1.2.5.RELEASE")
}
}
apply plugin: 'spring-boot'
apply plugin: 'java'
apply plugin: 'idea'
sourceCompatibility = 1.8
targetCompatibility = 1.8
idea {
module {
inheritOutputDirs = false
outputDir = file("$buildDir/classes/main/")
}
}
jar {
baseName = 'earthalive'
version = ""
}
repositories {
mavenCentral()
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.springframework.boot:spring-boot-starter-thymeleaf')
testCompile('org.springframework.boot:spring-boot-starter-test')
compile('net.sourceforge.nekohtml:nekohtml:1.9.22')
}
task wrapper(type: Wrapper) {
gradleVersion = '2.9'
}
Идеи?
У меня такая же проблема, любое решение для Maven? – PowerFlower
для maven смотрите https://docs.spring.io/spring-boot/docs/current/maven-plugin/usage.html. – jeton