gpt4 book ai didi

maven - 项目生成错误 : Non-resolvable parent POM

转载 作者:行者123 更新时间:2023-12-05 06:29:28 24 4
gpt4 key购买 nike

我正在开发一个 spring boot 应用程序。我使用的maven版本是3.3.9。在 settings.xml 中我也配置了代理。Maven 构建在命令提示符下获得 SUCCESS。但是当我尝试将项目导入 Eclipse 时出现项目构建错误。

我尝试解决错误的方法:

  1. 使用maven->更新maven项目(无改进)
  2. 在 eclipse 中,我更改了本地 m2 存储库的位置作为 windows->preferences->maven->user settings 并将其指向 C:\apache-maven-3.3.9\conf\settings.xml(无改进)
  3. 尝试执行 mvn eclipse:eclipse 命令。但它失败了。
  4. 在cmd中使用命令mvn clean install -U

pom 的内容

<?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>com.sample.eig</groupId>
<artifactId>ols</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>ols</name>
<description>Spring Boot Project</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.0.RELEASE</version>
<relativePath />
</parent>
<repositories>
<repository>
<id>0</id>
<name>TMS</name>
<url>http://archiva.sample.com:10203/archiva/repository/repo</url>
</repository>
</repositories>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<azure.version>0.2.3</azure.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.sendgrid</groupId>
<artifactId>sendgrid-java</artifactId>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
<version>2.3.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc4</artifactId>
<version>4.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>net.sourceforge.nekohtml</groupId>
<artifactId>nekohtml</artifactId>
<version>1.9.21</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>com.microsoft.ews-java-api</groupId>
<artifactId>ews-java-api</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.10.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

错误日志如下:

项目构建错误: 不可解析的父 POM 无法传输 org.springframework.boot:spring-boot-starter-parent:pom:2.0.0.RELEASE from http://repo.maven.apache.org/maven2/缓存在本地存储库中,在 artie 的更新间隔结束或强制更新之前,不会重新尝试解析。原始错误:无法将 Artifact org.springframework.boot:spring-boot-starter-parent:pom:2.0.0.RELEASE 从/转移到 artie ( http://repo.maven.apache.org/maven2/ ): NullPointerException 和 'parent.relativePath' 指向没有本地 POM pom.xml

最佳答案

检查您的互联网连接并确保您能够访问 http://repo.maven.apache.org/maven2/使用您的浏览器。如果是,检查是否需要配置代理服务器。如果不是,您应该联系您的互联网提供商。

参见 documentation ,关于如何为 Maven 配置代理服务器:

同时删除.m2本地目录并再次运行mvn clean install

更新:右键单击项目 --> Maven --> 更新项目。

关于maven - 项目生成错误 : Non-resolvable parent POM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53476367/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com