"Trent Rosenbaum" <[EMAIL PROTECTED]> writes:

> I have the following multi-module project structure as seen within the
> maven documentation.
>
> parent
> |-pom.xml
> |
> |-moduleJar
> |    |-pom.xml
> |
> |-moduleWar
>     |-pom.xml
>
> When I build the maven projects at the parent level the latest version
> moduleJar is built and then placed in the WEB-INF/lib folder of
> moduleWar.  If I build, (mvn package) at sub module level within
> moduleJar I get a build succesful and only the moduleJar is built, (as
> expected).  If I build again at the sub module level within the
> moduleWar project I get a build failure because it cannot locate an
> instance of moduleJar within the repos and tells me to install it
> through the standard manual process.  This was not expected.
>

Hello,
When you do 'mvn package', you do not put the artifact into the local
repository. You need to 'mvn install' for this to work. 

> Having set the picture above, I would have expected moduleWar to have
> used the information in the parent pom.xml to understand that the
> project had to compile moduleJar and then include it within the
> WEB-INF/lib folder.  If the parentpom.xml file did not reference
> moduleJar as a sub module then I would ahve expected Maven to search
> the repos.  As it standands if I worked within moduleWar with some
> plugins, e.g. jetty and tomcat then I need to complete a mvn install
> on moduleJar everytime I make a chnage to the sub module so it is
> picked up in moduleWar.

Yes. 

>
> I have looked through my archived store of emails from the list and
> cannot seem to find the righ answers.  I might be searching with the
> wrong criteria.  Would anyone be able to explain why maven has this
> behaviour?
>

There is no 'why' I think. It just works that way : dependencies are
resolved agains repo, not parent pom.

Not  sure that helps :-)

-- 
OQube < software engineering \ génie logiciel >
Arnaud Bailly, Dr.
\web> http://www.oqube.com


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

Reply via email to