maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Kolotyluk <>
Subject Re: Referencing a parent POM without relativePath
Date Sat, 24 Nov 2012 01:45:46 GMT
OK, I have added the following to our Corporate POM. Hopefully I, and 
others, won't fall into this trap again.

I still think the <userFriendly>true</userFriendly> version of Maven 
would just do the right thing when there is no <relativePath/> element, 
and there is no ../pom.xml. I can see no value in the current Maven 
behavior of throwing an error the way it does.

Cheers, Eric

        No parent for this POM! This is parent of all Kodak projects.
        Top Level Project POMs should reference this POM with


        The empty <relativePath/> element is necessary because com:kodak 
is a seperate project that will never be in
        the parent directory of your project. If <relativePath/> is 
missing, Maven will look in ../ by default, and
        then throw an error because it cannot find ../pom.xml (and you 
should never have ../pom.xml).

On 2012-11-23 12:47 PM, David Karr wrote:
> I had also discovered the difference between the missing vs. empty
> "relativePath" element.  Although it was initially disconcerting that I had
> to specify an empty "relativePath" element to get what I assumed was the
> most reasonable behavior, I can also see the logic of the alternative with
> the default value. I prefer to separate the notion of "parent" pom from
> "aggregator" pom (a pom with a list of modules), but if you use a strategy
> that combines them, then the default value is more likely.
> On Fri, Nov 23, 2012 at 12:34 PM, Eric Kolotyluk
> <>wrote:
>> DOH! I retract that previous message. I forgot to open my VPN connection
>> first.
>> Putting <relativePath/> in the POM does work!
>> So, would it be unreasonable if Maven treated the absence of the
>> <relativePath> element the same as <relativePath/>. That would make it
>> user friendly as far as I am concerned.
>> Also, it was m2e that built the original project POM, and it did not put
>> <relativePath/>  in the POM.
>> Cheers, Eric
>> On 2012-11-23 12:22 PM, Eric Kolotyluk wrote:
>>> I tried putting <relativePath/> in my POM, but it does not fix things.
>>>    <parent>
>>>      <groupId>com</groupId>
>>>      <artifactId>kodak</artifactId>
>>>      <version>0.0.11-SNAPSHOT</**version>
>>>      <relativePath/>
>>>    </parent>
>>> I still get
>>> C:\Users\Eric\workspace\tree-**combo-box>mvn clean
>>> [INFO] Scanning for projects...
>>> Downloading:**com:8082/nexus/content/groups/*
>>> *public/com/kodak/0.0.11-**SNAPSHOT/maven-metadata.xml<>
>>> [WARNING] Could not transfer metadata com:kodak:0.0.11-SNAPSHOT/**maven-metadata.xml
>>> from/to nexus (**
>>> com:8082/nexus/content/groups/**public<>):
>>> Downloading:**com:8082/nexus/content/groups/*
>>> *public/com/kodak/0.0.11-**SNAPSHOT/kodak-0.0.11-**SNAPSHOT.pom<>
>>> [ERROR] The build could not read 1 project -> [Help 1]
>>> [ERROR]
>>> [ERROR]   The project net.kolotyluk.experiment:tree-**combo-box:0.0.1-SNAPSHOT
>>> (C:\Users\Eric\workspace\tree-**combo-box\pom.xml) has 1 error
>>> [ERROR]     Non-resolvable parent POM: Could not transfer artifact
>>> com:kodak:pom:0.0.11-SNAPSHOT from/to nexus (*
>>> *com:8082/nexus/content/groups/**public<>):
>>> and 'parent.relativePath' points at no local POM
>>> @ line 9, column 11: Unknown host -> [Help 2]
>>> [ERROR]
>>> [ERROR] To see the full stack trace of the errors, re-run Maven with the
>>> -e switch.
>>> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
>>> [ERROR]
>>> [ERROR] For more information about the errors and possible solutions,
>>> please read the following articles:
>>> [ERROR] [Help 1]**confluence/display/MAVEN/**
>>> ProjectBuildingException<>
>>> [ERROR] [Help 2]**confluence/display/MAVEN/**
>>> UnresolvableModelException<>
>>> It looks like Maven wants to download the Corporate POM because it sees
>>> it in Nexus, but craps out because it does not like the Project POM. Maven
>>> seems pretty certain that it wants parent.relativePath to point to a local
>>> POM.
>>> Is there a <userFriendly>true</**userFriendly> switch I can turn
>>> somewhere in Maven ;-)
>>> Cheers, Eric
>>> On 2012-11-23 9:05 AM, Laird Nelson wrote:
>>>> On Fri, Nov 23, 2012 at 11:22 AM, Benson Margulies <
>>>>   You just name the G/A/V and no relativePath, and Maven will download
>>>>> just as it would a dependency.
>>>>>   Well, not exactly; if there is no <relativePath> element present,
>>>> Maven behaves as though <relativePath>../pom.xml</**relativePath>
>>>> specified.  If that file is a working copy that has not been refreshed
>>>> from
>>>> the SCM, then problems can ensue.
>>>> I recall that someone mentioned specifying a relative path like this:
>>>> <relativePath/>
>>>> ...and that that was the only way to force Maven to truly resolve the pom
>>>> from the repository, but I don't know if this is in fact true.
>>>> Best,
>>>> Laird
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: users-unsubscribe@maven.**<>
>> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message