首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SpringBoot:无法传递人造物

SpringBoot:无法传递人造物
EN

Stack Overflow用户
提问于 2022-07-20 11:04:15
回答 1查看 435关注 0票数 0

在IntelliJ中启动新项目有一个问题:

succesfully

  • "Reload
  • Maven构建总是终止所有Maven项目“导致错误的结果
  • 不能将org.springframework.boot.SpringApplication导入主类

这是我的pom.xml:

代码语言:javascript
复制
    <?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>
    
        <groupId>org.example</groupId>
        <artifactId>JavaTutorial</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <name>Java Tutorial Course API</name>
    
        <dependencyManagement>
            <dependencies>
                <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-parent</artifactId>
                    <version>1.3.2.RELEASE</version>
                    <scope>import</scope>
                    <type>pom</type>
                </dependency>
            </dependencies>
        </dependencyManagement>
    
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-web</artifactId>
                <version>1.3.2.RELEASE</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-autoconfigure</artifactId>
                <version>1.3.2.RELEASE</version>
            </dependency>
        </dependencies>
    
        <properties>
            <maven.compiler.source>7</maven.compiler.source>
            <maven.compiler.target>7</maven.compiler.target>
            <java.version>1.7</java.version>
        </properties>
    
    </project>

注意:,我尝试将<dependencyManager>添加到pom.xml中,但是没有任何改变。

主修班:

代码语言:javascript
复制
    package springbootstarter;
    
    import org.springframework.boot.SpringApplication;
    
    @SpringBootApplication
    public class CourseApiApp {
    
        public static void main(String[] args) {
    
        }
    }

尝试Reload Maven项目时引发的错误:

代码语言:javascript
复制
org.springframework.boot:spring-boot-starter-web:pom:1.3.2.RELEASE failed to transfer from https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.springframework.boot:spring-boot-starter-web:pom:1.3.2.RELEASE from/to central (https://repo.maven.apache.org/maven2): transfer failed for https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-web/1.3.2.RELEASE/spring-boot-starter-web-1.3.2.RELEASE.pom

org.springframework.boot:spring-boot-autoconfigure:pom:1.3.2.RELEASE failed to transfer from https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.springframework.boot:spring-boot-autoconfigure:pom:1.3.2.RELEASE from/to central (https://repo.maven.apache.org/maven2): transfer failed for https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-autoconfigure/1.3.2.RELEASE/spring-boot-autoconfigure-1.3.2.RELEASE.pom

任何帮助都将不胜感激。我一直在寻找解决办法,但没有成功。

EN

回答 1

Stack Overflow用户

发布于 2022-07-20 11:25:28

日志看起来非常干净,项目试图下载依赖项,但是它无法下载。

代码语言:javascript
复制
org.springframework.boot:spring-boot-starter-web:pom:1.3.2.RELEASE failed to transfer from https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.springframework.boot:spring-boot-starter-web:pom:1.3.2.RELEASE from/to central (https://repo.maven.apache.org/maven2): transfer failed for https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-web/1.3.2.RELEASE/spring-boot-starter-web-1.3.2.RELEASE.pom

所以,首先检查您与https://repo.maven.apache.org/maven2的连接,然后验证该依赖项和特定版本是否仍然存在,因为它确实很旧。如果是这样,那么尝试强制下载依赖项,如果使用maven,则可以使用:

代码语言:javascript
复制
mvn dependency:resolve

注意:要知道,如果您在代理后面,则必须将代理配置为能够被maven/gradle使用

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73050520

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档