SpringBoot项目无法传输神器

问题描述 投票:0回答:2

我使用 SpringInitializer 创建了一个新的 SpringBoot 3.1.5 项目。 当我尝试使用 Intellij 构建时,出现以下错误:无法从/到中央传输工件 org.springframework.boot:spring-boot-starter-parent:pom:3.1.5 (https://repo.maven)。 apache.org/maven2):传输失败https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/3.1.5/spring-boot-starter-父级-3.1.5.pom

我使用的是 JDK 17,Maven 3.9.5 我在代理后面,我在 m2/ 和 maven_homedirectory/conf 中的setting.xml 中设置了代理

我在 Intellij 设置/SystemSetting/HttpProxy 中验证了我的代理的连接,它正在工作

可能是什么问题?

谢谢!

我尝试在设置xml中设置代理,更改pom.xml

maven build dependencies
2个回答
0
投票

我尝试使用 Gradle(7.2 - 我的版本)构建一个类似的 SpringBoot 项目,它成功了。

我猜我第一次设置的问题是 Maven。这种情况我能做什么呢?我仍然收到错误 无法从/向中央传输工件 org.springframework.boot:spring-boot-starter-parent:pom:3.1.5 (https://repo.maven.apache.org/maven2):https 传输失败://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/3.1.5/spring-boot-starter-parent-3.1.5.pom

谢谢!


0
投票

同样,Java 17、Maven 3.9.5 和 springframework 3.1.5。 无法使用 Maven 命令行构建项目 我的 POM.XML:

<?xml version="1.0" encoding="UTF-8"?>

4.0.0 org.springframework.boot spring-boot-starter-父级 3.1.5 com.springboot.blog springboot-博客-rest-api 0.0.1-快照 springboot-博客-rest-api 适用于 RESTAPI 的 Spring Boot 博客应用程序 17 1.17 1.17 org.springframework.boot spring-boot-starter-数据-jpa 3.1.5 org.springframework.boot spring-boot-启动器-web 3.1.5

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <version>3.1.5</version>
        <scope>runtime</scope>
        <optional>true</optional>
    </dependency>
    <dependency>
        <groupId>com.mysql</groupId>
        <artifactId>mysql-connector-j</artifactId>
        <version>8.0.33</version>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <scope>provided</scope>
        <optional>true</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <version>3.1.5</version>
        <scope>test</scope>
    </dependency>
</dependencies>
</dependencyManagement>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <image>
                    <builder>paketobuildpacks/builder-jammy-base:latest</builder>
                </image>
                <excludes>
                    <exclude>
                        <groupId>org.projectlombok</groupId>
                        <artifactId>lombok</artifactId>
                    </exclude>
                </excludes>
            </configuration>
        </plugin>
    </plugins>
</build>
© www.soinside.com 2019 - 2024. All rights reserved.