【发布时间】:2020-11-08 21:54:40
【问题描述】:
我正在尝试在一个简单的 Spring Boot 应用程序 (Maven) 中注入 spring-boot-starter-security 依赖项。我尝试从实际 Spring 网站的“保护 Web 应用程序”教程中复制此依赖项,我还尝试将其与 spring 安全测试依赖项和 thymeleaf spring 安全依赖项一起实现。
以下是出现“未找到”错误的依赖项:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity5</artifactId>
</dependency>
这是完整的 pom 文件:
4.0.0 org.springframework.boot spring-boot-starter-parent 2.3.1.发布 com.homehero 家庭英雄 0.0.1 战争
<properties>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</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>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity5</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
我觉得有必要提前感谢你们,如果我错过了一些非常愚蠢的事情,我很抱歉,我真的希望我没有!
【问题讨论】:
-
请添加错误日志输出...。
-
嗨@khmarbaise,我在日志中没有收到错误消息。我可以运行应用程序而不会遇到任何问题。
标签: java spring spring-boot maven spring-security