pom.xml Can't resolve parent?

2019-08-12 06:37发布

I am a "noob" with maven and I am running a mvn clean install for a open source project I found. I am trying to get it to build a jar file. When I run it the way it "supposedly" is going to work. I get this error...

Non-resolvable parent POM: Could not find artifact
com.gorillalogic.monkeytalk:monkeytalk:pom:1.0.12-SNAPSHOT and 'parent.relativePath'
points at wrong local POM @ line 6, column 10 -> [Help 2]

For the pom.xml file @ line 6-10 I have...

<parent>
    <groupId>com.gorillalogic.monkeytalk</groupId>
    <artifactId>monkeytalk</artifactId>
    <version>1.0.12-SNAPSHOT</version>
</parent>

Is there a step I am missing? I can give more code if you need it?

Thanks in advance!

3条回答
该账号已被封号
2楼-- · 2019-08-12 07:06

the parent project maybe not installed yet, try run the parent project "monkeytalk" as Maven install.

how to install the parent project in eclipse

查看更多
叛逆
3楼-- · 2019-08-12 07:08

You are missing the parent projects pom.

Most likely your folder structure looks like this:

.../moneytalk_Foo/pom.xml
.../moneytalk_Foo/someFolder

but it should look like this:

.../pom.xml
.../moneytalk_Foo/pom.xml
.../moneytalk_Foo/someFolder

Or that parent is a project into itself and you must download it and call mvn install on it yourself.

查看更多
Anthone
4楼-- · 2019-08-12 07:16

Not sure if this is a cure all for everyone seeing this, but for me it was because my maven settings.xml file was not being found. Maven uses this file to locate remote repos for downloading SNAPSHOT files so if it can't find the settings.xml file then parent.relativePath is essentially undefined. Pretty crappy error message for this IMO, it should dump the value of parent.relativePath to give some indication of an undefined var.

查看更多
登录 后发表回答