I have created a simple Spring Boot app using IntelliJ that use Spring Boot Devtools as dependency and Gradle as build automation with option: Use default gradle wrapper
. However, the Devtools seems not working. When I change my html file, the page does not updated even though I refresh it several times. I use Spring Boot Devtools docs as reference.
My application.properties
is empty
Here is my build.gradle
:
buildscript {
ext {
springBootVersion = '2.0.5.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-thymeleaf')
compile('org.springframework.boot:spring-boot-starter-web')
compile("org.springframework.boot:spring-boot-devtools")
testCompile('org.springframework.boot:spring-boot-starter-test')
}
Interesting fact:
I have tried in several Spring Boot versions (from 1.5.12.RELEASE
until 2.1.0.RELEASE
), but the result is still the same.
But when I switch from Gradle to Maven, the Devtools surprisingly worked!
Any clue anyone? I want to use Gradle, not Maven.
Additional information:
- OS: Ubuntu 18.04
- IDE: IntelliJ 2018.2
- Java:
openjdk 11 2018-09-25
- Gradle version: 4.8.1
- Gradle JVM:
java version 1.8.0__151
- Gradle run method:
./gradlew bootRun
- Maven version: 3.5.2
- Maven run method:
mvn spring-boot:run
INFO
), but if needed, I can provide the debug message log. – Ascogoniumgradle bootRun
but still not working. Actually in my description above, I run Gradle and Maven separately, not together, just want to know if I use Maven, it will work or not. – Ascogonium