我试着用thymeleaf和布局模板构建一个springboot项目。为此,我在pom.xml中包含了spring boot starter thymeleaf和thymeleaf布局方言。但是当我试着跑的时候,我得到了错误
Could not find artifact org.thymeleaf:thymeleaf-spring5:pom:2.4.1 in central (https://repo.maven.apache.org/maven2)
和
Could not find artifact org.thymeleaf:thymeleaf:pom:2.4.1 in central (https://repo.maven.apache.org/maven2)
我使用的是所有依赖项的最新版本,在google上搜索过,但没有找到任何答案。有谁能告诉我这个错误是从哪里来的,怎么解决?我会非常感激的。
我的pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
4.0.0
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.5.RELEASE</version>
</parent>
<groupId>com.project</groupId>
<artifactId>lucis</artifactId>
<version>1.0-SNAPSHOT</version>
<name>lucis</name>
<properties>
<java.version>1.8</java.version>
<springboot.version>2.2.5.RELEASE</springboot.version>
<thymeleaf.version>2.4.1</thymeleaf.version>
<mysql.version>8.0.19</mysql.version>
<bootstrap.version>4.4.1</bootstrap.version>
<jquery.version>3.4.1</jquery.version>
<locator.version>0.39</locator.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${springboot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
<version>${springboot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>${springboot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<version>${springboot.version}</version>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>nz.net.ultraq.thymeleaf</groupId>
<artifactId>thymeleaf-layout-dialect</artifactId>
<version>${thymeleaf.version}</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>${bootstrap.version}</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>${jquery.version}</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>webjars-locator</artifactId>
<version>${locator.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
<scope>runtime</scope>
</dependency>
<!--<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>-->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>