You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Douglas WF Acheson <do...@bpsserver.com> on 2006/05/29 17:35:19 UTC

Understanding modules

Hello,

  Now that I have been working with M2 for sometime, I still feel like a
noob :-)  Anyways, here is my scenario and question:

I have create a structure such as

dir/project
dir/project/modA
dir/project/modB
dir/project/modC

I have a pom for each module (which include the project level pom as its
parent), and a pom at the project level. The project level pom includes
the module tag, which identifies the correct modules.  When I issues m2
commands from the top level directory everything (so far) seems to work.
But, when I issues commands from certain modules, it does not work the
way I expected.  Here is the issue

Module B depends upon module A, so when I want to compile and test only
module B, I get an error that the dependency for module A cannot be
found in the repository.  I understand this error, but do not know why
it is happening.  I expect that since module B is dependant upon module
A (as this is listed in the dependency section) that A would be built
for B.  But, it does not.  Why is this the case.

Regards,
Douglas WF Acheson




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


Re: Understanding modules

Posted by Barrie Treloar <ba...@gmail.com>.
> As you've already said, calling a 'mvn install' in the root dir works, because there you've defined your <modules>!

This is the benefit (and sometimes a curse) when working with Maven.

That is, you are dependent upon binary files not the source files.

This makes sharing and managing your projects easier.

It does make developing them more difficult in your IDE if the
projects depend upon the library version instead of the source version
as you must remember to run mvn install on dependent projects to get
the latest changes available for the current project.

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


Re: Understanding modules

Posted by Roland Asmann <Ro...@cfc.at>.
Having a dependency on a module, does NOT mean that it will be built! If you have a dependency on JUnit,
it is also only copied from your local repository. The only reason for a POM to build another module is when
it is defined in the <modules>-list.

So, if you go into your modA and run a 'mvn install', then change to modB and do the same, everything should
work fine (presuming the groupId's and artifactId's are correct of course).

As you've already said, calling a 'mvn install' in the root dir works, because there you've defined your <modules>!

Hope this helped,

Roland




On Monday 29 May 2006 17:35, Douglas WF Acheson wrote:
> Hello,
>
>   Now that I have been working with M2 for sometime, I still feel like a
> noob :-)  Anyways, here is my scenario and question:
>
> I have create a structure such as
>
> dir/project
> dir/project/modA
> dir/project/modB
> dir/project/modC
>
> I have a pom for each module (which include the project level pom as its
> parent), and a pom at the project level. The project level pom includes
> the module tag, which identifies the correct modules.  When I issues m2
> commands from the top level directory everything (so far) seems to work.
> But, when I issues commands from certain modules, it does not work the
> way I expected.  Here is the issue
>
> Module B depends upon module A, so when I want to compile and test only
> module B, I get an error that the dependency for module A cannot be
> found in the repository.  I understand this error, but do not know why
> it is happening.  I expect that since module B is dependant upon module
> A (as this is listed in the dependency section) that A would be built
> for B.  But, it does not.  Why is this the case.
>
> Regards,
> Douglas WF Acheson
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org


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