Hi,

From how I understand on how the <relativePath> works, it is used for resolving the parent pom (being inside the parent tag).

When you run mvn on a sub-module, mvn detects that the sub-module has a parent and mvn tries to resolve that using either the groupId:artifactId:version for the parent tag or the relativePath if it is not available in the local/remote repository yet.

Although your argument is valid (please create a jira request if you want), I would not suggest that its a good approach.

Consider this scenario:

parentA has modules moduleA and moduleB where moduleB depends on moduleA.

If I try to build moduleB, when mvn finds that moduleA has not yet been installed, then it will try to build moduleA. but what if during the build of moduleA, a problem occurred? Then it will be confusing for me to see the moduleA errors when I was trying to build moduleB.

So the approach is, if you want to use an artifact, then that artifact must have been previously built and installed for use by other projects.

Just my two cents, btw.

^_^



Grothaus, Christoph wrote:

Hi maven-users!

I've got a m2 project with several levels of sub-modules, held together by a main pom of packaging type 
"pom". In each sub-module there is a <parent> entry pointing to the module above, including the 
<relativePath> tag pointing to "../" .

I don't quite understand the use of the <relativePath> tag. If I build the whole 
project, everything works fine, obviously because I'm starting the reactor from the top. If 
I try to build only sub-module X maven complains that it can't get the poms for the other 
sub-modules X depends on. Okay, now I could solve that if I ran mvn install on all 
sub-modules X needs. But what use is the <relativePath> tag then? Wouldn't it be 
nicer if maven saw that there is a parent module and that the other sub-modules X needs are 
not so far away?

Maybe I look at this from the wrong direction and should get used to walk up some 
directories to start a reactor build. But I come back to my initial question: why is 
there a <relativePath> tag if maven doesn't look at it and just looks at the 
(local and remote) repos?

Christoph Grothaus


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to