spring-boot - 如果从 IntelliJ IDEA 运行,则找不到 Spring Boot 模板
问题描述
我刚刚使用 Intellij IDEA Ultimate 2019.2.3 创建了一个新的 Spring Boot(2.1.8) Gradle 项目,该项目具有基于 Java 12 的 Thymeleaf 支持。
如果我创建一个引导 jar 文件并从命令行执行该 jar,那么该应用程序可以正常工作。所以代码/模板和目录应该没问题。
但是,如果我从 IDE 模板运行应用程序,则解析不起作用。我得到了“通常”的错误:
Error resolving template [auth/login], template might not exist or might not be accessible by any of the configured Template Resolvers
我的旧项目运行良好。该问题仅存在于 IDEA 2019.2.3 生成的项目中
自动生成的 gradle 文件如下所示:
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'
}
我试图弄清楚它是否是 IDE 设置的结果或生成的 gradle 构建脚本或其他问题的结果。
解决方案
推荐阅读
- python - 用索引列表重新排列 3d numpy 数组
- regex - 正则表达式匹配接下来的 1 到 3 个单词和之后的任何内容
- java - 后备默认意图应仅匹配 1 个以上的单词
- angular - 无法在 html 中以角度 4 离子 3 显示数组对象
- spring - 如何在我的客户端服务中监听 Eureka 服务器中新注册的服务?监听 Eureka 服务器事件
- django - 无法登录到谷歌堆栈驱动程序日志记录 django + gunicorn + nGINX?
- angular - 如何在路由器出口外传递数据?角 4
- gremlin - 添加多个唯一顶点
- android - 尝试从相机保存图像会在 Xamarin Android 中引发 NullReferenceException
- powershell - 如何从 CSV 更改 AD 中的多个电话号码