On Wed, Jul 20, 2011 at 10:22 AM, kanesee <kane...@gmail.com> wrote:
> I guess I don't really understand the Maven modules then.
>
> Well, this is what I have. My company has a bunch of "components" and our
> own home-brewed build system. We want to translate it to the Maven
> environment.
> The "library components" depend on each other in that they may reference
> classes in other components (but no cyclic references exist). So there may
> be library component A, B, and C. Let's say A and B both depend on C.
> We also have "product components" that groups the library components it
> needs for a product. So product X may need A and product Y may need A and B.
>
> I'd like to be able to run mvn on the product components and have it
> automatically compile and package its library components.
>
> So is dependency or module more appropriate here or some mix of the two?

Libraries = Dependency.

Parts of a single Product = Modules.  (If its re-used across another
product then its dependency again).

You probably need to re-educate the way you think about your build system.
I haven't re-read the books in a while but have a look at
http://maven.apache.org/articles.html there are at least two books
there that should give guidance and explain what you need to do.

When you build Product X the libraries A, B and C should already
exist.  You dont want to rebuild them just to build Product X, that
will slow down your development process.
Ideally A, B, and C are released versions, but if you find a bug in
them then you will be using SNAPSHOT versions, which will need to be
released separately prior to releasing Product X.
If developers are rarely touching the libraries then its better to let
your continuous build system (e.g. Jenkins) build the libraries and
Maven will automatically pull down the latest SNAPSHOT for you.
This way Developer D can fix a bug in A and Developer E will
automatically get the bug fix the next time they pull down the
SNAPSHOT build of library A, they no longer need to resync and
manually build.
You can configure how often Maven will check for a snapshot update
(see updatePolicy
http://maven.apache.org/ref/3.0.3/maven-settings/settings.html#class_snapshots)

With a continuous build system in place whenever C changes it will
automatically schedule a build for A and B, run your unit tests and
report success or failure.
It should also then build Product X and Y for you (since a downstream
dependency changed), again running your unit tests.

You will also want a Repository Manager so that it can keep some
control over how many SNAPSHOT versions to keep (otherwise you can
find yourself running out of disk space)

Hope this helps some.

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

Reply via email to