When building the directed graph of how to order the modules at build time, Maven doesn't consider (that I'm aware of) the existence of a dependency in the local repo. Are you using versions to describe the dependency between these modules? That's about the only thing that comes to mind? (even though they are the same version, it may influence it somehow)
You can try reordering the modules in your pom, this would possibly cause this problem to go away, but tf you can make a sample project for this, I'd be interested in taking a look. --Brian -----Original Message----- From: Eric Swenson [mailto:eswen...@intertrust.com] Sent: Wednesday, February 18, 2009 1:39 PM To: users@maven.apache.org Cc: e...@swenson.org; Eric Swenson Subject: Dependency/Version Issue with maven We're running into an issue that causes our automated builds to fail quite frequently now and wonder what it is about our use of maven that is causing this. The builds are failing because the order in which maven (2.0.9) is choosing to build the components of a large, multi-component project is "wrong". The question we are trying to answer is "how to get maven to build in the right order". Here is the failing scenario. Say there are two modules, Module1 and Module2 where Module1 depends on Module2. A developer makes an incompatible change to Module2 and makes a corresponding change to Module1 so that it becomes compatible with the updated Module2. The version number in neither pom is updated since we are using snapshots, and this change is but one of many in a lifecycle of changes for these versions of the two components. If the build machine completely wipes the local maven repository, pulls afresh from source controls, and does a "mvn clean install", of course, everything works just fine. However, our build machine doesn't wipe the local repository, does an "svn update", and a "mvn install". In this case, maven must do something along the lines of: * Realizes that Module1 needs to be rebuilt because of changes of source files for that module * Realizes that Module2 needs to be rebuilt because of changes of sources files for that module * Looks at the dependency lists of all modules and decides to build Module1 first, followed by Module2. It noted that Module1 was dependent on Module2, but it looked at the version number of the dependency and noted that the local maven repository already has an (old) version of the Module2 artifact - same version number, but an old (incompatible) snapshot). So it concluded, since there was already the correct version in the maven local repo, that it didn't need to build Module2 first. * It compiles Module1, which fails because Module2 is required to be rebuilt first (and the local maven repo updated with the changes). What are we doing wrong in our use of maven here that makes this not work? We don't want to have to clean out the local repo before each build. Changing the build to use "mvn clean install" doesn't help. The exact same problem occurs for the exact same reason. Note, although we are using snapshot versions for all our components, we are NOT deploying to a shared repository (or even the build machine's local repository). Any help or suggestions on changes to our use of maven? n Eric --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org