我正在尝试在 pom.xml 中添加 jwt,但 jwt 依赖项不可用。
有没有相同经历的人?
我将使用 Jwtbuilder 进行安全设置。
Springboot 是 2.2.6,我正在使用 Maven。
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.6.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>co.kr.hatchfly</groupId>
<artifactId>hf</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>hf</name>
<description>hatchfly home</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>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.9.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
最佳答案
当我添加与您的情况相同的 io.jsonwebtoken 依赖项时,我遇到了类似“找不到依赖项 io.jsonwebtoken::jjwt:0.9.1”的问题。
对我来说:加载 maven 依赖项(对于 intellij idea 为 ctrl+shift+o)解决了问题。
关于spring-boot - 在 Springboot 2.2.6 中找不到 jwt 依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61731215/