2

I just created a new Spring Boot(2.1.8) Gradle project with Thymeleaf support based on Java 12 using Intellij IDEA Ultimate 2019.2.3.

If I create a boot jar file and execute the jar from the command line then the app works fine. So the code/template and directories should be fine.

However, if I run the app from the IDE template resolving doesn't work. I got the "usual" error:

Error resolving template [auth/login], template might not exist or might not be accessible by any of the configured Template Resolvers

My old projects are working fine. The problem is present only with the projects generated by IDEA 2019.2.3

The automatically generated gradle file looks like this:

plugins {
    id 'org.springframework.boot' version '2.1.8.RELEASE'
    id 'io.spring.dependency-management' version '1.0.8.RELEASE'
    id 'java'
}

group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'

configurations {
    developmentOnly
    runtimeClasspath {
        extendsFrom developmentOnly
    }
}

repositories {
    mavenCentral()
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
    implementation 'org.springframework.boot:spring-boot-starter-web'
    developmentOnly 'org.springframework.boot:spring-boot-devtools'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

I'm trying to figure it out if it is a result of an IDE settings or a problem with the generated gradle build script or something else.

Vmxes
  • 2,329
  • 2
  • 19
  • 34
  • Have you checked https://stackoverflow.com/questions/42947454/thymeleaf-cannot-detect-templates-inside-spring-boot-project/42947560 ? – Bancarel Valentin Oct 08 '19 at 12:24
  • Also tere is a note concerning IDEA in https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-developing-web-applications.html#boot-features-spring-mvc-template-engines – Bancarel Valentin Oct 08 '19 at 12:29
  • As a workaround I have switched back to IDEA 2019.1.4 and it solved the problem. – Vmxes Oct 08 '19 at 13:51

0 Answers0