OK,  it is new to me, the multi modules build  ( reactor) is smart enought
to remember to module's A classpath when build module B.

However, if you builld to module B directly.  Its know only module A
thru dependency, which must be in local or remote repo
But last time you only compile module A, so its artifact does not get
installed in local repo.

So the solution is

   goto module A, run maven install

   then goto module B, run maven compile it should work.


-Dan



On 12/25/05, Tom Huybrechts <[EMAIL PROTECTED]> wrote:
>
> Actually, mvn compile at the parent does work. At runtime, maven will
> replace the artifact dependency with a reference to the module.
>
> From the debug output of the compile of module B:
>
> [DEBUG]   (f) basedir = C:\Temp\maventest\parent\..\moduleB
> [DEBUG]   (f) buildDirectory = C:\Temp\maventest\parent\..\moduleB\target
> [DEBUG]   (f) classpathElements =
> [C:\Temp\maventest\parent\..\moduleB\target\classes,
> C:\Temp\maventest\parent\..\moduleA\target\classes]
> [DEBUG]   (f) compileSourceRoots =
> [C:\Temp\maventest\parent\..\moduleB\src\main\java]
>
> Notice that the target/classes for moduleA is on the classpath of module B
> !
>
> So I wonder why this doesn't happen if I compile directly in module B.
>
> Tom
>
> On 25/12/05, dan tran <[EMAIL PROTECTED]> wrote:
> >
> > mvn compile at the parent wont work.  It compile fine module A
> first.  But
> > it does not
> > install A into local repo so that module B can pickup.  So correct way
> is
> >
> >   maven install
> >
> > -D
> >
> >
> > On 12/24/05, Tom Huybrechts <[EMAIL PROTECTED]> wrote:
> > >
> > > Suppose I have a multi-module setup, with one parent project
> containing
> > > two
> > > modules moduleA and moduleB, and moduleB has a dependency on module A.
> > >
> > > If I do 'mvn compile' in the parent project, the compile for moduleB
> > will
> > > nicely use the output directory of moduleA on its classpath (after
> > > compiling
> > > moduleA off course).
> > >
> > > Now, is this also supposed to work when I start the compile from
> moduleB
> > > itself, given that I have already manually done a compile in moduleA
> > ?  It
> > > doesn't work for me, and it seems like maven has enough information
> > > available to use the artifacts in moduleAs directory, without having
> to
> > > install them in the local repository.
> > >
> > > Thanks,
> > >
> > > Tom
> > >
> > >
> >
> >
>
>

Reply via email to