Thymeleaf 配置 - 无法导入 org.thymeleaf.spring4.*



我正在我的spring-boot web应用程序中使用Thymeleaf,并且我正在尝试将Thymelief已经提供的功能用于Spring Boot项目。但是,我无法导入org.thymeleaf.spring4.* - 实际上,spring4 根本不被识别。我正在使用百里香叶 3.0.11。

实际上,在我的项目中,gradle 被用作构建自动化工具,并且添加了 Thymeleaf,如下所示(在多模块 Spring Boot 应用程序中,此 gradle 文件对应于配置 Thymeleaf 模板引擎的模块(:

configurations.all {
resolutionStrategy {
...
dependencySubstitution {
...
substitute module('org.thymeleaf:thymeleaf') with module('org.thymeleaf:thymeleaf:3.0.11.RELEASE')
}
}
}

我将不胜感激关于发生这种情况的原因的任何想法?

确保在pom中添加了依赖关系.xml

<!-- https://mvnrepository.com/artifact/org.thymeleaf/thymeleaf-spring4 -->
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf-spring4</artifactId>
<version>3.0.11.RELEASE</version>
</dependency>

相关内容

最新更新