You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Rafael Ribeiro <ra...@gmail.com> on 2011/10/31 21:01:08 UTC

parent pom resolution problem in maven 3

Hi all,

 I am having issues regarding parent pom resolution in maven 3. I am aware
that some changes were made in order to make it stricter and less
problematic as pointed out in
https://cwiki.apache.org/MAVEN/maven-3x-compatibility-notes.html#Maven3.xCompatibilityNotes-ParentPOMResolutionbut
I am having exactly the issue that should have been fixed.
 My build only works if invoked from parent pom directory and note that I
use exactly what is described as the default structure (parent pom on
parent directory). If instead I try to build the dependant project only it
fails complaining that it cannot find parent pom (as it were a dependency
of the other module I really depend on).
 I am sending a sample I developed in case anyone can help me finding what
I could possibly done wrong (and sincerely I made it so simple that I
cannot find anything that could be changed).

best regards,
Rafael Ribeiro

Re: parent pom resolution problem in maven 3

Posted by Hilco Wijbenga <hi...@gmail.com>.
On 31 October 2011 16:10, Rafael Ribeiro <ra...@gmail.com> wrote:
> Hilco, I am not saying that it should work without installing common but it
> fails even after installing common and the reason is cause it sees parent
> as a dependency of common and fails to look it up locally thru relativePath
> resolution (either with default value or forcefully specifying as
> ../pom.xml)

Mmm, it seems to work for me. I do the following:

tests> mvn clean install
tests> rm -rf ~/.m2/repository/br/rar/test/gui
tests> cd gui
gui> mvn clean package

This works fine. Even without relativePath. So I'm guessing you are do
something else?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: parent pom resolution problem in maven 3

Posted by Hilco Wijbenga <hi...@gmail.com>.
On 1 November 2011 06:33, Guo Du <mr...@duguo.org> wrote:
>>> It should work without install on ROOT level.
>> You tried that? It certainly does not work for me.
>
> Following commands DOES work for me:
>
> tar -xzvf parent-pom-sample-problem.tar.gz
> cd tests
> mvn clean
> mvn validate
> mvn package

That's the root level. And you can simply do "mvn clean package".

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: parent pom resolution problem in maven 3

Posted by Guo Du <mr...@duguo.org>.
>> It should work without install on ROOT level.
> You tried that? It certainly does not work for me.

Following commands DOES work for me:

tar -xzvf parent-pom-sample-problem.tar.gz
cd tests
mvn clean
mvn validate
mvn package


-Guo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: parent pom resolution problem in maven 3

Posted by Hilco Wijbenga <hi...@gmail.com>.
On 31 October 2011 16:25, Guo Du <mr...@duguo.org> wrote:
> On Mon, Oct 31, 2011 at 11:10 PM, Rafael Ribeiro <ra...@gmail.com> wrote:
>> Hilco, I am not saying that it should work without installing common but it
> It should work without install on ROOT level.

You tried that? It certainly does not work for me.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: parent pom resolution problem in maven 3

Posted by Guo Du <mr...@duguo.org>.
On Mon, Oct 31, 2011 at 11:10 PM, Rafael Ribeiro <ra...@gmail.com> wrote:
> Hilco, I am not saying that it should work without installing common but it
It should work without install on ROOT level.

> fails even after installing common and the reason is cause it sees parent
> as a dependency of common and fails to look it up locally thru relativePath
> resolution (either with default value or forcefully specifying as
This is expected as maven resolve common as dependency while the
dependency in your local repo cannot find the parent in your local
repo. At this point, common doesn't aware of your local source parent
pom.

As a general practice, you should always build your project from root
until you understand how maven and your project dependency
relationship works.

Just a clean up suggestion for your sample poms: you don't need
"<packaging>jar</packaging>" as it's default, less is more :)

-Guo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: parent pom resolution problem in maven 3

Posted by Rafael Ribeiro <ra...@gmail.com>.
Hilco, I am not saying that it should work without installing common but it
fails even after installing common and the reason is cause it sees parent
as a dependency of common and fails to look it up locally thru relativePath
resolution (either with default value or forcefully specifying as
../pom.xml)
Em 31/10/2011 19:54, "Hilco Wijbenga" <hi...@gmail.com> escreveu:

> On 31 October 2011 15:40, Rafael Ribeiro <ra...@gmail.com> wrote:
> > Did you run it on project root? Cause this works for me too as I said on
> > 1st email but it fails if I try to run on gui directory. The error
> message
> > on 3.0 is sth that could not resolve parent pom locally and it is
> slightly
> > different on 3.0.3 I'll paste it over here as soon as I reach a PC.
>
> I tried root and common, not gui. :-) Project gui does indeed fail,
> but what would you expect? Project common has not been installed yet.
>
> If you run root once (and don't change either root or common) then you
> can install gui by running mvn there.
>
> I generally avoid reactor builds as I find them slow and painful so I
> may not be fully up-to-date but does the latest documentation really
> imply that building gui should work without building common first?
> That would certainly be very nice but rather surprising. :-)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: parent pom resolution problem in maven 3

Posted by Hilco Wijbenga <hi...@gmail.com>.
On 31 October 2011 15:40, Rafael Ribeiro <ra...@gmail.com> wrote:
> Did you run it on project root? Cause this works for me too as I said on
> 1st email but it fails if I try to run on gui directory. The error message
> on 3.0 is sth that could not resolve parent pom locally and it is slightly
> different on 3.0.3 I'll paste it over here as soon as I reach a PC.

I tried root and common, not gui. :-) Project gui does indeed fail,
but what would you expect? Project common has not been installed yet.

If you run root once (and don't change either root or common) then you
can install gui by running mvn there.

I generally avoid reactor builds as I find them slow and painful so I
may not be fully up-to-date but does the latest documentation really
imply that building gui should work without building common first?
That would certainly be very nice but rather surprising. :-)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: parent pom resolution problem in maven 3

Posted by Rafael Ribeiro <ra...@gmail.com>.
Did you run it on project root? Cause this works for me too as I said on
1st email but it fails if I try to run on gui directory. The error message
on 3.0 is sth that could not resolve parent pom locally and it is slightly
different on 3.0.3 I'll paste it over here as soon as I reach a PC.
Em 31/10/2011 18:43, "Hilco Wijbenga" <hi...@gmail.com> escreveu:

> On 31 October 2011 13:01, Rafael Ribeiro <ra...@gmail.com> wrote:
> >  I am sending a sample I developed in case anyone can help me finding
> what I
> > could possibly done wrong (and sincerely I made it so simple that I
> cannot
> > find anything that could be changed).
>
> What exactly is the problem? I tried your example and it seems to work
> fine.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: parent pom resolution problem in maven 3

Posted by Hilco Wijbenga <hi...@gmail.com>.
On 31 October 2011 13:01, Rafael Ribeiro <ra...@gmail.com> wrote:
>  I am sending a sample I developed in case anyone can help me finding what I
> could possibly done wrong (and sincerely I made it so simple that I cannot
> find anything that could be changed).

What exactly is the problem? I tried your example and it seems to work fine.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: parent pom resolution problem in maven 3

Posted by Rafael Ribeiro <ra...@gmail.com>.
I did not tried to install but shouldn't it work without installing? At
least that what I understand from the docs. And I tried adding the
relativePath but it did no difference as I am using the default value, so
omitting gives the same result.
Em 31/10/2011 18:38, "G. Gustavo Pollitzer" <gg...@intelap.com> escreveu:

> On 31/10/2011 5:01 PM, Rafael Ribeiro wrote:
>
>> Hi all,
>>
>>  I am having issues regarding parent pom resolution in maven 3. I am
>> aware that some changes were made in order to make it stricter and less
>> problematic as pointed out in https://cwiki.apache.org/**
>> MAVEN/maven-3x-compatibility-**notes.html#Maven3.**xCompatibilityNotes-**
>> ParentPOMResolution<https://cwiki.apache.org/MAVEN/maven-3x-compatibility-notes.html#Maven3.xCompatibilityNotes-ParentPOMResolution>but I am having exactly the issue that should have been fixed.
>>  My build only works if invoked from parent pom directory and note that I
>> use exactly what is described as the default structure (parent pom on
>> parent directory). If instead I try to build the dependant project only it
>> fails complaining that it cannot find parent pom (as it were a dependency
>> of the other module I really depend on).
>>  I am sending a sample I developed in case anyone can help me finding
>> what I could possibly done wrong (and sincerely I made it so simple that I
>> cannot find anything that could be changed).
>>
>> best regards,
>> Rafael Ribeiro
>>
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: users-unsubscribe@maven.**apache.org<us...@maven.apache.org>
>> For additional commands, e-mail: users-help@maven.apache.org
>>
> Is the parent artifact already in your local repository. If its not,
> install it if possible, or use the <relativePath> element inside the
> <parent> element in your child projects. Perhaps this solves your problem.
>

Re: parent pom resolution problem in maven 3

Posted by "G. Gustavo Pollitzer" <gg...@intelap.com>.
On 31/10/2011 5:01 PM, Rafael Ribeiro wrote:
> Hi all,
>
>  I am having issues regarding parent pom resolution in maven 3. I am 
> aware that some changes were made in order to make it stricter and 
> less problematic as pointed out in 
> https://cwiki.apache.org/MAVEN/maven-3x-compatibility-notes.html#Maven3.xCompatibilityNotes-ParentPOMResolution 
> but I am having exactly the issue that should have been fixed.
>  My build only works if invoked from parent pom directory and note 
> that I use exactly what is described as the default structure (parent 
> pom on parent directory). If instead I try to build the dependant 
> project only it fails complaining that it cannot find parent pom (as 
> it were a dependency of the other module I really depend on).
>  I am sending a sample I developed in case anyone can help me finding 
> what I could possibly done wrong (and sincerely I made it so simple 
> that I cannot find anything that could be changed).
>
> best regards,
> Rafael Ribeiro
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
Is the parent artifact already in your local repository. If its not, 
install it if possible, or use the <relativePath> element inside the 
<parent> element in your child projects. Perhaps this solves your problem.