当前位置: 首页 > 知识库问答 >
问题:

未找到依赖项“org.springframework.boot:spring-boot-starter-security:2.2.6.release”

聂建茗
2023-03-14

我是新来spring的,所以如果你们中的任何人能在这方面帮助我,我将非常感激。我添加了一个spring-boot-starter-security的依赖项,其当前版本为2.2.6.release,我的父版本也有相同的版本。但还是有个错误-

未找到依赖项“org.springframework.boot:spring-boot-starter-security:2.2.6.release”。标记名称:artifactId描述:项目组生成的工件的唯一id,例如maven-artifact。版本:3.0.0+*

**如有任何错误,敬请原谅!**

<?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.6.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.arpita</groupId>
    <artifactId>security_first</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>security_first</name>
    <description>Demo project for Spring Boot</description>

    <properties>
        <java.version>11</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-security -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
            <version>2.2.6.RELEASE</version>
        </dependency>

共有3个答案

高迪
2023-03-14

file->使缓存无效/重新启动,它就会工作。

柯学
2023-03-14

您无需提及spring boot项目的版本,它将由spring boot添加以下依赖项

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>

最后,更新您的项目

澹台权
2023-03-14

顺便说一句,您不需要为starter POM指定版本。如果从security starter中删除version标记,它应该可以正常工作。

 类似资料:
  • 我正在遵循以下指南:https://spring.io/guides/gs/service-web-content/, 但我在POM上遇到了这个问题: 但在这里是https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-parent/2.4.0

  • 尝试部署 Web 应用程序时,由于日志记录错误(如下所示),它将失败: Java . lang . nosuchmethoderror:org . SLF 4j . SPI . locationawarelogger . log(Lorg/SLF 4j/Marker;ljava/lang/String;il Java/lang/String;ljava/lang/Throwable;) 我已经谷歌

  • 我试图在一个简单的Spring Boot应用程序(Maven)中注入spring-boot-starter-security依赖项。我试图从实际的Spring网站上的“保护Web应用程序”教程中复制这个依赖项,我还尝试将它与Spring security test依赖项和thymeleaf Spring security依赖项一起实现。 下面是得到错误“找不到”的依赖项: 我觉得有必要提前感谢你们

  • 我创建了一个sbt项目。在命令行调用sbt compile可以很好地工作: scalaVersion:=“2.9.2” project/plugins.sbt addSbtPlugin(“com.typesafe.sbteclipse”%“sbteclipse-plugin”%“2.1.0”) 我现在发现控制台上的“SBT测试”也不起作用。所以我认为这不是sbteclipse的问题,而是如何处理测

  • 我已经在gradle文件中添加了依赖项,但仍然无法识别jar文件的类。 我得到错误-不能解决类在这里 我已经提到了以下几点 Android Studio缺少外部依赖项 Android Studio坚持使用“Gradle:resolve Dependencies'_debugCompile'”或“detachedConfiguration1” 如何添加本地. jar文件依赖build.gradle文