简体   繁体   English

项目 'org.springframework.boot:spring-boot-starter-parent:2.4.0' 未找到

[英]Project 'org.springframework.boot:spring-boot-starter-parent:2.4.0' not found

I am following this guide: https://spring.io/guides/gs/serving-web-content/ ,我正在关注本指南: https://spring.io/guides/gs/serving-web-content/

<?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 http://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.4.0</version>
        <relativePath/>
    </parent>

    <groupId>org.example</groupId>
    <artifactId>plats-bruts</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
    <java.version>1.8</java.version>
</properties>

<dependencies>
    <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>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <scope>runtime</scope>
        <optional>true</optional>
    </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>

</project>

but I have this problem on the pom:但我在 pom 上有这个问题:

Project 'org.springframework.boot:spring-boot-starter-parent:2.4.0' not found

but Its here https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-parent/2.4.0但它在这里https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-parent/2.4.0

I just ran into a similar problem.我刚刚遇到了类似的问题。 I'm using IntelliJ IDEA Ultimate 2020.2.我正在使用 IntelliJ IDEA Ultimate 2020.2。 The version number 2.4.0 was red and the message was the same as yours.版本号 2.4.0 是红色的,消息和你的一样。

Selecting File -> Invalidate Caches / Restart... and choosing the Invalidate and Restart option fixed the issue.选择 File -> Invalidate Caches / Restart... 并选择 Invalidate and Restart 选项修复了该问题。 I guess it was just a stale cache.我想这只是一个陈旧的缓存。

Spring Boot's starter parent pom certainly does exist in Maven Central . Spring Boot 的 starter parent pom 确实存在于 Maven Central 中

I copied your pom.xml and ran mvn test using Maven 3.6.3.我复制了你的pom.xml并使用 Maven 3.6.3 运行了mvn test All required libraries, including the parent pom were downloaded just fine.所有必需的库,包括父 pom 都下载得很好。 You will probably want to look at your ~/.m2/settings.xml file to see if any proxies are active that are preventing you from connecting to Maven Central.您可能想要查看您的~/.m2/settings.xml文件,以查看是否有任何代理处于活动状态,阻止您连接到 Maven Central。

Probably you are trying to run mvn spring-boot:run directly.可能您正在尝试直接运行mvn spring-boot:run

You can use the wrapper instead cf.您可以使用包装器代替 cf。 ./mvnw spring-boot:run This should fix your problem. ./mvnw spring-boot:run这应该可以解决您的问题。

What worked for me was re-building and remote caches and then local caches.对我有用的是重新构建和远程缓存,然后是本地缓存。 Here're the steps I followed (on Mac, please translate to your target environment):以下是我遵循的步骤(在 Mac 上,请转换为您的目标环境):

  1. Goto Preferences Menu: ie: IntelliJ IDEA > Preferences转到首选项菜单:即:IntelliJ IDEA > 首选项
  2. Under Build Tools: ie: "Build, Execution, Deployment" > Build Tools在构建工具下:即:“构建、执行、部署”> 构建工具
  3. Select Repositories: ie: Maven > Repositories选择存储库:即:Maven > 存储库
  4. Notice the Remote and Local repositories, and the Update button注意远程和本地存储库,以及更新按钮
  5. Select Each repository and click Update.选择每个存储库并单击更新。 This will take a while depending on your internet speed, but it will do a complete check of the broken downloads and stale Maven caches这将需要一段时间,具体取决于您的互联网速度,但它会全面检查损坏的下载和陈旧的 Maven 缓存

I'm using IntelliJ IDEA Ultimate 2021.1.1.我正在使用 IntelliJ IDEA Ultimate 2021.1.1。 The version number 2.5.4 Spring Boot.版本号 2.5.4 Spring Boot。 I just restarted Intellij and the error was fixed.我刚刚重新启动了 Intellij,错误已修复。

Just reload your Maven project in the IDE.只需在 IDE 中重新加载您的 Maven 项目。 It will work.它会起作用。

就我而言, mvn clean帮助我解决了同样的问题。

Short Answer: Double check if your internet provider is blocked maven repo https://repo.maven.apache.org/maven2/ site mistakenly. Short Answer: Double check if your internet provider is blocked maven repo https://repo.maven.apache.org/maven2/ site mistakenly.

I also encounter with this problem.我也遇到这个问题。 For my case, I tried everything, like invalidate cache and restart Intellij, re-import the maven dependencies.对于我的情况,我尝试了所有方法,例如使缓存无效并重新启动 Intellij,重新导入 maven 依赖项。 But those are not working for me.但那些对我不起作用。

When I try to re-import the maven dependencies with my mobile data, then everything is okay.当我尝试使用我的移动数据重新导入 maven 依赖项时,一切正常。 So, there was a problem with my internet provider.所以,我的互联网提供商有问题。

After I inform them, then I was fixed.在我通知他们之后,我就确定了。 Thanks谢谢

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 org.springframework.boot:spring-boot-starter-parent:2.4.0' 未找到 - org.springframework.boot:spring-boot-starter-parent:2.4.0' not found 找不到 org.springframework.boot:spring-boot-starter-parent:2.4.9.RELEASE - Could not find org.springframework.boot:spring-boot-starter-parent:2.4.9.RELEASE 无法传输工件 org.springframework.boot:spring-boot-starter-parent:pom - Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom 项目构建错误:org.springframework.boot:spring-boot-starter-parent:[unknown-version] 的不可解析父 POM:传输失败 - Project build error: Non-resolvable parent POM for org.springframework.boot:spring-boot-starter-parent:[unknown-version]: Failure to transfer 项目构建错误:Non-resolvable parent POM: Failure to transfer org.springframework.boot:spring-boot-starter-parent: - Project build error: Non-resolvable parent POM: Failure to transfer org.springframework.boot:spring-boot-starter- parent: “依赖&#39;org.springframework.boot:spring-boot-starter-log4j2:2.3.5.RELEASE&#39;未找到” - "Dependency 'org.springframework.boot:spring-boot-starter-log4j2:2.3.5.RELEASE' not found " 未找到依赖项 'org.springframework.boot:spring-boot-starter-security:2.2.6.RELEASE' - Dependency 'org.springframework.boot:spring-boot-starter-security:2.2.6.RELEASE' not found 未找到依赖项 &#39;org.springframework.boot:spring-boot-starter-validation:2.5.1&#39; - Dependency 'org.springframework.boot:spring-boot-starter-validation:2.5.1' not found 未找到依赖项 'org.springframework.boot:spring-boot-starter-web:2.3.0.RELEASE' - Dependency 'org.springframework.boot:spring-boot-starter-web:2.3.0.RELEASE' not found 未找到依赖项 &#39;org.springframework.boot:spring-boot-starter-data-jpa:2.5.3&#39; - Dependency 'org.springframework.boot:spring-boot-starter-data-jpa:2.5.3' not found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM