Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

build - Maven:Non-resolvable parent POM and 'parent.relativePath' points at wrong local POM

I am using maven 3 to run the application but I am getting the following error:

[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:Mastershesis related papers and toolsjunitcategorizerpom.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

I have the following parent pom file (part of it):

<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>

I have the following child module pom file:

 <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>

I tried commenting the below part in the parent pom file( i don't know if it is correct to do it), then this error is gone and the build fails with this error.

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

Please help me!

Thanks

question from:https://stackoverflow.com/questions/36450720/mavennon-resolvable-parent-pom-and-parent-relativepath-points-at-wrong-local

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The normal layout for a maven multi module project is:

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

Check that you use this layout.

Additionally:

  1. the relativePath looks strange. Instead of '..'

    <relativePath>..</relativePath>
    

    try '../' instead:

    <relativePath>../</relativePath>
    

    You can also remove relativePath if you use the standard layout. This is what I always do, and on the command line I can build as well the parent (and all modules) or only a single module.

  2. The module path may be wrong. In the parent you define the module as:

    <module>junitcategorizer.cutdetection</module>
    

    You must specify the name of the folder of the child module, not an artifact identifier. If junitcategorizer.cutdetection is not the name of the folder than change it accordingly.

Hope that helps..

EDIT have a look at the other post, I answered there.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...