java - 为什么我在添加 spring-boot-starter-security 依赖项时在 pom.xml 文件中出现未知错误?
问题描述
将spring-boot-starter-security 依赖项添加到 pom.xml 文件后出现未知错误。我也尝试在 Eclipse 中使用 maven--->update project 选项,但错误仍然存在。我 100% 确定错误与上述依赖有关,因为当我删除它时问题解决了。
pom.xml 文件
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.4.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>com.hasiya.springboot.demo</groupId>
<artifactId>firstSpringBootApp</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>firstSpringBootApp</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</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-devtools</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
解决方案
推荐阅读
- flutter - 重启 CircularCountdownTimer 颤振 onComplete
- wordpress - 页面子项不会出现在 wp_nav_menu 中
- python - python boto无法获取docker容器的环境变量
- python - 在 GPU(而不是 CPU)上运行对象检测算法的问题
- javascript - 通过数组映射后根据索引对对象数组进行排序
- javascript - 浏览器扩展兼容性 - 检查浏览器是 chrome 还是 firefox
- r - 尽管在 r 中使用 as.POSIXct 时间跨过午夜,但日期并没有改变
- c# - C# File System Watcher windows 服务发生内存泄漏,无法追踪导致内存泄漏的原因
- python - 内置身份验证视图的 Django Admin 不会消失
- javascript - 在javascript嵌套循环中获取未知整数