首页 > 解决方案 > eclipse中的Spring Boot项目设置错误

问题描述

我已经使用https://start.spring.io/创建了一个项目,当我将该项目导入我的 Eclipse 时,它​​给出了错误

Project build error: Non-resolvable parent POM for 
com.spring:micro-finance:0.0.1-SNAPSHOT: Could not transfer artifact 

org.springframework.boot:spring-boot-starter-parent:pom:2.2.6.RELEASE from/to 
uk.maven.org (https://repo1.maven.org/maven2): Failed to authenticate with proxy and 'parent.relativePath' points at no local POM   pom.xml /project-name   line 
5   Maven pom Loading Problem

这是我的 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 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.spring</groupId>
<artifactId>Demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Demo</name>
<description>Demo project in Spring Boot</description>

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

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </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>

我在 apache-maven-3.6.0\conf\settings.xml 中添加了 porxy 详细信息

我有另一个项目在 Eclipse 中完美运行,它的 Spring Boot 版本是 2.1.2.RELEASE,当我将上述项目更改为 2.1.2.RELEASE 版本时,错误正在得到解决。

标签: javaeclipsespring-bootmaven

解决方案


推荐阅读