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

SpringBoot:无法传输工件

黄浩涆
2023-03-14

在IntelliJ中启动新项目时,我遇到了一个问题:

    < li>Maven构建总是成功终止 < li >“重新加载所有Maven项目”导致错误 < li >无法将org . spring framework . boot . spring application导入主类

这是我的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 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>

注意:我尝试添加

主要类别:

    package springbootstarter;
    
    import org.springframework.boot.SpringApplication;
    
    @SpringBootApplication
    public class CourseApiApp {
    
        public static void main(String[] args) {
    
        }
    }

尝试重新加载 Maven 项目时引发的错误:

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

任何帮助将不胜感激。我正在寻找任何解决方案,但没有成功。


共有1个答案

逑何平
2023-03-14

日志看起来非常干净,该项目正在尝试下载依赖项,但它无法下载。

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,您可以使用:

mvn dependency:resolve

注意:请注意,如果您在代理后面,您必须配置代理以便能够被maven/gradle使用

 类似资料:
  • 我使用Maven的Spring boot项目。当我使用Intellij社区构建它时,我得到了一个错误 无法将工件com.jolira:hickory:pom:1.0.0从/传输到central(https://repo.maven.apache.org/maven2):https://repo.maven.apache.org/maven2/com/jolira/hickory/1.0.0/hic

  • 我刚刚在Jenkins上启动了一个在nexus存储库中部署工件的工作,但我得到了下面的消息。 [信息]-----------------------------------------------------------------------------------------------------------------------------------------------------

  • 本文向大家介绍springboot集成rabbitMQ之对象传输的方法,包括了springboot集成rabbitMQ之对象传输的方法的使用技巧和注意事项,需要的朋友参考一下 rabbitMQ的安装方法网上有很多教程,这里就不重复了。 在springboot上使用rabbitMQ传输字符串和对象,本文所给出的例子是在两个不同的项目之间进行对象和和字符串的传输。 rabbitMQ的依赖(在两个项目中

  • 问题内容: 尝试通过ServiceStack.Redis读取Redis列表时,间歇性出现以下错误:“无法从传输连接读取数据:已建立的连接被主机中的软件中止了”。我想知道我如何使用ServiceStack可靠地连接和池化Redis的整个概念是否是错误的。这是我使用密封类和单例模式进行连接的代码: 然后,我实例化另一个使用单例的类: 这又是从“服务” DTO回调中实例化和调用的: 然后,我使用“邮递员

  • 我有一个克隆项目的问题: 无法传输工件org.springframework.boot:sping-boot-maven-plugin:pom:2.1.7。从/到中心(https://repo.maven.apache.org/maven2)释放:https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-ma

  • 问题内容: 我是Maven的新手,尝试在Maven中设置我的第一个项目,但是在Eclipse中执行“ Run as-> Maven install”时收到以下错误消息。以下是我的settings.xml和pom.xml Settings.xml POM文件 错误信息: 如何解决收到的致命警报:protocol_version?我的Java版本是1.7,而Maven版本是3.3.3 问题答案: So