mavnewbie (7) [Avatar] Offline
#1
I first built sip-top, then I built recipe2.1. the error I get is that it cannot find the parent pom.
Can any please point out what it is complaining about?
Error is attached below:

Apache Maven 3.1.0 (893ca28a1da9d5f51ac03827af98bb730128f9f2; 2013-06-28 12:15:32+1000)
Maven home: CsmilieROGRA~1Maven-3.1.0in..
Java version: 1.7.0_25, vendor: Oracle Corporation
Java home: Csmilierogra~1Javajdk1.7.0_25jre
Default locale: en_AU, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from CsmilieROGRA~1Maven-3.1.0in..confsettings.xml
[DEBUG] Reading user settings from C:UsersKathie.m2settings.xml
[DEBUG] Using local repository at C:UsersKathie.m2 epository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for C:UsersKathie.m2 epository
[INFO] Scanning for projects...
[DEBUG] Using connector WagonRepositoryConnector with priority 0.0 for http://repo.maven.apache.org/maven2
Downloading: http://repo.maven.apache.org/maven2/com/springinpractice/com.springinpractice.top/1.0-RELEASE/com.springinpractice.top-1.0-RELEASE.pom

[DEBUG] Writing tracking file C:UsersKathie.m2 epositorycomspringinpracticecom.springinpractice.top1.0-RELEASEcom.springinpractice.top-1.0-RELEASE.pom.lastUpdated
[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: Could not find artifact com.springinpractice:com.springinpractice.top:pom:1.0-RELEASE in central (http://repo.maven.apache.org/maven2) and 'parent.relativePath' points at wrong local POM @ line 22, column 10
MikB (202) [Avatar] Offline
#2
Re: Non-resolvable parent POM: Could not find artifact
If this is Eclipse it's could be related to lack of support for hierarchical Maven projects. I solved this by putting the parent project at the same level as the children ones and then repointing the POMs accordingly.

A silly limitation, but a real one.
mavnewbie (7) [Avatar] Offline
#3
Re: Non-resolvable parent POM: Could not find artifact
Hi MikB, the file structure I have currently is as the way the samples are unzipped of the download. ie. user.home/sip-code/sip-code/ ..where sip-top or chapter recipes eg. sip02 recipe-2.1 are located (they are at the same level, aren't they?)
How do you repoint the pom as you suggested?

1) I cd to the dir where the pom.xml for sip-top is and build this first, which writes a file for the pom in the /.m2/repository

2) then I try to build the recipe-2.1 at the location of this recipe's pom -- this returns error regarding not finding the parent pom. I can see
"[DEBUG] Writing tracking file C:UsersKathie.m2 epositorycomspringinpracticecom.springinpractice.top1.0-RELEASEcom.springinpractice.top-1.0-RELEASE.pom.lastUpdated"

isn't this the file that it can't find? Doesn't it go to the local repository for this?
MikB (202) [Avatar] Offline
#4
Re: Non-resolvable parent POM: Could not find artifact
What I suggested is relevant for Eclipse, not for building from the command line with maven.
willie.wheeler (110) [Avatar] Offline
#5
Re: Non-resolvable parent POM: Could not find artifact
For the command line, be sure to run

mvn install

on the parent pom.
willie.wheeler (110) [Avatar] Offline
#6
Re: Non-resolvable parent POM: Could not find artifact
(Running "mvn install" causes the project and its subprojects to go into the local repo, where other projects (like the chapter-specific projects) can see it.)
mavnewbie (7) [Avatar] Offline
#7
Re: Non-resolvable parent POM: Could not find artifact
Yes, of course doing this certainly resolved the problem. Many thanks. I also realized that you did mention about doing this as part of your online guide.
mavnewbie (7) [Avatar] Offline
#8
Re: Non-resolvable parent POM: Could not find artifact
Yes, thanks for the prompt answer.
manoj7shekhawat (4) [Avatar] Offline
#9
Re: Non-resolvable parent POM: Could not find artifact
Thank you soo much. I got stuck and resolved it with your suggestion. Thanks again!!
Pranav25 (2) [Avatar] Offline
#10
Re: Non-resolvable parent POM: Could not find artifact
hi I am also facing this issue in eclipse

Can somebody explain below. This is what i found in forums
If this is Eclipse it's could be related to lack of support for hierarchical Maven projects. I solved this by putting the parent project at the same level as the children ones and then repointing the POMs accordingly.
MikB (202) [Avatar] Offline
#11
Re: Non-resolvable parent POM: Could not find artifact
You tried all of the above including "mvn install" and you still have issues?