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

执行:不可解析的父 POM 和“父级路径”指向错误的本地 POM

东方弘壮
2023-03-14

我正在使用maven 3运行该应用程序,但我收到以下错误:

[ERROR] The build could not read 1 project -> [Help 1]
org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM: Failure to find com.topdesk:tis-parent:pom:3.
4 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ line 3, column 11
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:416)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:663)
    at org.apache.maven.DefaultMaven.getProjectsForMavenReactor(DefaultMaven.java:654)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:243)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:582)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR]
[ERROR]   The project com.topdesk.test.junitcategorizer:junitcategorizer:0.0.1-SNAPSHOT (D:\Masters\thesis related papers and tools\junitcategorizer\pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM: Failure to find com.topdesk:tis-parent:pom:3.4 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM@ line 3, column 11 -> [Help 2]org.apache.maven.model.resolution.UnresolvableModelException: Failure to find com.topdesk:tis-parent:pom:3.4 in https://repo.maven.apache.org/maven2 was cachedin the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
    at org.apache.maven.project.ProjectModelResolver.resolveModel(ProjectModelResolver.java:187)
    at org.apache.maven.project.ProjectModelResolver.resolveModel(ProjectModelResolver.java:236)
    at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultodelBuilder.java:898)
    at org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:750)
    at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:309)
    at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:463)
    at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:432)
    at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:396)
    at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:663)
    at org.apache.maven.DefaultMaven.getProjectsForMavenReactor(DefaultMaven.java:654)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:243)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:582)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Failure to find com.topdesk:tis-parent:pom:3.4 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:459)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:262)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:239)
    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:295)
    at org.apache.maven.project.ProjectModelResolver.resolveModel(ProjectModelResolver.java:183)
    ... 22 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Failure to find com.topdesk:tis-parent:pom:3.4 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
    at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.newException(DefaultUpdateCheckManager.java:232)
    at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:206)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.gatherDownloads(DefaultArtifactResolver.java:599)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:518)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:436)
    ... 26 more

我有以下父pom文件(其中的一部分):

<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.topdesk</groupId>
<artifactId>tis-parent</artifactId>
<version>3.4</version>
</parent>

<groupId>com.topdesk.test.junitcategorizer</groupId>
<artifactId>junitcategorizer</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>JUnitCategorizer</name>

<modules>
<module>junitcategorizer.instrument</module>
<module>junitcategorizer.examples</module>
<module>junitcategorizer.reporter.maven</module>
<module>junitcategorizer.reporter.maven.site</module>
<module>junitcategorizer.cutdetection</module>
</modules>
<organization>
    <name>TOP Informatie Systemen bv</name>
    <url>http://www.topdesk.com/</url>
</organization>

<properties>
    <project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>utf-8</project.reporting.outputEncoding>
    <surefire.version>2.12</surefire.version>
</properties>

<prerequisites>
    <maven>3.0</maven>
</prerequisites>

我有以下子模块pom文件:

 <modelVersion>4.0.0</modelVersion>
 <parent>
<artifactId>junitcategorizer</artifactId>
<groupId>com.topdesk.test.junitcategorizer</groupId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>junitcategorizer.cutdetection</artifactId>
<name>Analysis of parameters for the CUT detection algorithm</name>
<description>Analysis of parameters for the CUT detection algorithm</description>
<dependencies>
<dependency>
    <groupId>com.topdesk.test.junitcategorizer</groupId>
    <artifactId>junitcategorizer.instrument</artifactId>
    <version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
</project>

我试着在父pom文件中注释下面的部分(我不知道这样做是否正确),然后这个错误就消失了,构建也因这个错误而失败。

<parent>
<groupId>com.topdesk</groupId>
<artifactId>tis-parent</artifactId>
<version>3.4</version>
</parent>

请帮帮我!

谢谢

共有3个答案

满耀
2023-03-14

java版本中存在冲突。在对maven使用1.8后解决。

岑畅
2023-03-14

我可能有点晚了,但是我在TOPdesk为我的论文项目写了一部分。早期版本确实使用了公司内部的父POM。所以你的问题是由父POM无法解决引起的,因为它对外界来说是不可用的。

您可以:

  • 删除
<parent>
    <groupId>com.topdesk</groupId>
    <artifactId>open-source-parent</artifactId>
    <version>1.2.0</version>
</parent>

金晗日
2023-03-14

maven多模块项目的正常布局是:

parent
├── pom.xml
├── module
    ├── pom.xml

检查是否使用此布局。

此外:

>

  • relativePath看起来很奇怪。而不是“..”

    <relativePath>..</relativePath>
    

    “尝试”../'代替:

    <relativePath>../</relativePath>
    

    如果使用标准布局,还可以删除relativePath。这是我一直在做的,在命令行上,我还可以构建父模块(和所有模块),或者只构建单个模块。

    模块路径可能错误。在父级中,您将模块定义为:

    <module>junitcategorizer.cutdetection</module>
    

    您必须指定子模块的文件夹名称,而不是工件标识符。如果< code > JUnit categorizer . cut detection 不是文件夹的名称,请相应地更改它。

    希望有所帮助。

    编辑看看别的帖子,我在那里回答的。

  •  类似资料:
    • 下面是我的pom.xml文件:

    • null 项目生成错误:无法解析得父POM无法传输org.springframework.boot:spring-boot-starter-parent:POM:2.0.0.来自http://repo.maven.apache.org/maven2/得版本已缓存在本地存储库中,在经过artie得更新间隔或强制更新之前,将不会重新尝试解析.原始错误:无法传输项目org.springframework

    • 这是我第一个使用spring Boot的项目。因此我尝试用父级更新pom.xml,如下所示: 然而,我在行中出现了一个错误: 项目生成错误:com.in28minutes的父POM不可解析。springboot:first-springboot-project:0.0.1-snapshot:找不到项目org.springframework.boot:spring-boot-starter-pare

    • 我是Spring的新手,我正在尝试创建一个Spring入门项目。然而,我的pom.xml.有一个错误。 行<代码> 我看到了这些链接,但并没有解决我的问题。 项目生成错误:不可解析的父POM。无法转移组织。springframework。启动:spring启动程序父级 Maven:不可解析的父POM

    • 我试图添加依赖到我的maven项目。我想添加Spring引导配置。但是它在父标签中给出了这个错误, 项目构建错误: io.javabrains.springbootquickstart的不可解析父POM: Court-api: 0.0.1-SNAPSHOT:未能找到 org.springframework-boot: spall-boot-starter-父: pom: 1.4.2。https:/

    • 我为我的项目创建了一个gitlab-ci。 当我运行管道时,我面临以下错误: [致命][projectName]的父POM不可解析-父:0.0.1-快照:无法将项目org.springframework.boot:spring-boot-starter-父:POM:2.4.0从/到[serverName]:[serverName]/org/springframework/boot/spring-b