AARGH - mixed posting style! When someone puts their reply at the bottom
of your email, please do not be so rude as to then put your reply at the
top. That makes things almost impossible to read. I'll reply here at the
top as this is the least bad option now..
...
If B and C need library A, then they just add A into their dependency
section:
<dependency>
<groupId>group.of.A</groupId>
<artifactId>artifactIdOfA</artifactId>
<version>desired.version.of.A</version>
</dependency>
B and C can have any parent they want.
This is just like dealing with the case where "A" is produced by some
other company. The only issue is that "A" has to be available in either
your local repository (ie a directory on your computer) or one of the
known repositories.
If this code is just for one person, then just run "mvn install" for A
before trying to compile B or C. That puts it into your local repository
(ie ~/.m2/repository for unix machines).
Alternately, if this code all belongs together, then just put "A" in a
directory next to "B" and "C" and then have a pom in the parent
directory that uses <module> tags to point to "A", "B" and "C". Then
running "mvn install" against that higher pom will build all three
together. That pom might be used as a parent of A, B and C, or might not
- your choice.
If you have a team of developers, then it might be better to instead set
up a repository (that's just an ordinary http web-server) and run "mvn
deploy A" to make A available via that server[1]. Then your team can
compile B and C without first compiling A, as a binary is already
available. Of course you need some config to tell maven where to copy
the file to, and how. And users of A need some config to tell maven
where to fetch it from.
You should probably read the online book "better builds with Maven" for
some background, or the "getting started" pages on the maven website.
Regards, Simon
On Sat, 2008-02-09 at 08:35 -0800, oliverw wrote:
> Sorry if I didn't make myself clear enough :)
>
> I am talking about what should be a pretty common use case: A little class
> library which we call libX and one or more utilities that depend on that
> library. We call them UtilA and UtilB.
>
> I would like to have maven powered project layout that covers all three
> project and which lets me build UtilA and UtilB independly, yet resolving
> the dependency on libX for both.
>
>
> Wendy Smoak-3 wrote:
> >
> > On Feb 9, 2008 7:41 AM, oliverw <[EMAIL PROTECTED]> wrote:
> >
> >> Let's say we have project A producing a class library consumed by
> >> projects B
> >> and C. Is there a way around making A the parent of B and C?
> >
> > In B and C, declare a dependency on A.
> >
> > If you give a more concrete example, you'll probably get better
> > advice. What are you building, and what made you think A should be
> > the parent?
> >
> > --
> > Wendy
> >
> > ---------------------------------------------------------------------
> > 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]