Wayne, thanks for the reply. It is interesting to know that Maven determines the proper build ordering of the modules itself. As you may have surmised, the example I described is a simplified version of my real-life scenario, as I thought it would be easier to understand if I took out all of the extraneous data. The real-life pom file that parallels the mod1 pom does, indeed, have the sub-modules declared. This is what allows the install of those sub-modules to succeed when, as I said, I change directory into mod1 and run the same 'mvn install' command. It also has the parent pom defined, as it inherits configuration settings made only in the top-level pom file. I'm not sure what dependency would be missing, as it is the unresolved declared dependency on mod1B that makes the install of mod2 to fail. Anything else you or anyone else can think of that I might should look for?
Tim -----Original Message----- From: Wayne Fay [mailto:[EMAIL PROTECTED] Sent: Thursday, May 24, 2007 12:16 AM To: Maven Users List Subject: Re: trouble building a multi-module project with cross-module dependencies As I understand it, ordering of modules in the pom.xml file has nearly nothing to do with the way the pom is processed by Maven, so that assumption is incorrect. Maven should automatically find all your poms (assuming modules are declared) and resolve the proper graph that will allow it to successfully build your artifacts using the dependencies, modules, etc you have declared. It sounds like you are missing either a dependency or more likely a module/parent declaration in one of your poms, most likely the mod1 pom.xml file. Without seeing all the poms etc I can't be certain, but that's just what it sounds like. Wayne On 5/23/07, Tim Foster <[EMAIL PROTECTED]> wrote: > I'm having trouble building a multi-module project structured as below: > > > > top > > |-- pom.xml > > |-- mod1 > > | |-- pom.xml > > | |-- mod1A > > | | |-- pom.xml > > | | `-- src.... > > | |-- mod1B > > | |-- pom.xml > > | `-- src.... > > |-- mod2 > > | |-- pom.xml > > | `-- src.... > > `src... > > > > Additionally, mod1 is listed ahead of mod2 in the top-level pom.xml > file, so I expect mod1 (and thus also its sub-modules) to be processed > first. Also, mod2 has a dependency on mod1B. > > > > I run 'mvn install' from the top level, expecting it to a) include all > of the phases in the lifecycle up to install as described in the > documentation > (http://maven.apache.org/guides/introduction/introduction-to-the-lifecyc > le.html) and b) to do this recursively. With that assumption, I think > that mod1B should be installed before mod2 is processed. But that is > not the case, as the build of mod2 fails because mod1B is not found in > the local repository. What seems to be happening is that the > sub-modules of mod1 are not being processed, as evidenced by the > following message: > > > > [INFO] No goals needed for project - skipping > > > > Rather, the only thing that gets done when processing mod1 when the > command is invoked from the top-level project directory is that the pom > file is installed (i.e., as a result of package type of "pom" for the > module). > > > > Now if I change directory into mod1 and run the same 'mvn install' > command, the mod1A and mod1B modules are installed. Then, I can run > 'mvn install' from the top level and the dependency on mod1B is > satisfied when processing mod2. Obviously I don't want to have this > take multiple invocations of mvn to build my project. Are my > assumptions correct about how recursion is supposed to work and, if so, > is there something extra I need to do in order to have the sub-modules > down the hierarchy to be processed? > > > > Tim > > > > --------------------------------------------------------------------- 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]
