Steve, See my comments below.
<s.garcia>Suppose I have a single maven project <b.hartin>(let's call it projectA)</b.hartin> and it requires the Log4J jar file and some jar file called "projectB-1.0.jar". All maven would do is try to download the projectB artifact from the maven.repo.local, and if that failed it would to go a remote repository. If that failed the compile goal fails.</s.garcia> <b.hartin>I think this is because the <m:reactor .../> tag isn't processed because the project depends on the missing artifact "projectB-1.0.jar". If the reactor ran first, it would discover that 'projectB' is a local project, build it and put it in the repository. Then projectA's dependencies would be satisfied.</b.hartin> <s.garcia>I think what you want is for Maven to recognize that the "projectB-1.0.jar" is actually an artifact that can be produced by some other maven project, and have it find that project.xml and compile/jar:install that jar into the maven.repo.local repository. How would maven know that projectB is an artifact that can be produced on your system and not a normal one that can be downloaded? At this point I'm not sure. I don't think that is in there. </s.garcia> <b.hartin>See my comment above. It seems that the fact that projectA has unresolved dependencies 'short-circuits' the build; why shouldn't the reactor be allowed to attempt to do its work first?</b.hartin> <s.garcia>Perhaps it's reasonable to say "Maven, compile the "buildA" project and if it has any dependencies first look at the other project.xml files in this fileset to see if any other project can build that artifact. If not then go to the repository." Right now, if you use the maven:reactor does it build all projects (A, B, C, D, E) even if you only want to build A and it's dependencies, in this case B and C? I guess it still builds D and E.</s.garcia> <b.hartin>I think this is exactly what it does: it builds a dependency graph by inspecting all project.xml files which match the filters. This graph may, of course, be composed of disconnected subgraphs, e.g. (A->B, B->C, A->C) and (D->E, E->F). I think it then builds everything in the graph, in the correct order, _unless_ you specify in the filters to exclude D, E and F. I wish that it were smart enough that if I said to build A, it would just build things reachable from A in the dependency graph. Maybe we just haven't looked far enough. I can't believe it doesn't have this capability, since it doesn't seem like there really would be any bootstrapping issues that would prevent the reactor from running before the 'current' project's dependencies are checked. Hopefully someone else will chime in on this one. Thanks for the discussion so far, Brian Hartin </b.hartin> -----Original Message----- From: Steve Garcia [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 01, 2003 4:33 PM To: 'Maven Users List' Subject: RE: Beginner's question about reactor Yea you basically got it right. However I was under the impression that when you specify the "include" and "exclude" tags of the maven:reactor tag it would 1) first find all project.xml files according to the fileset and exclude the ones that match your exclude pattern and 2) work out which projects to compile first based on the project.xml dependencies. I think what you are asking for should be reasonable, however it's not in. Suppose I have a single maven project and it requires the Log4J jar file and some jar file called "projectB-1.0.jar". All maven would do is try to download the projectB artifact from the maven.repo.local, and if that failed it would to go a remote repository. If that failed the compile goal fails. I think what you want is for Maven to recognize that the "projectB-1.0.jar" is actually an artifact that can be produced by some other maven project, and have it find that project.xml and compile/jar:install that jar into the maven.repo.local repository. How would maven know that projectB is an artifact that can be produced on your system and not a normal one that can be downloaded? At this point I'm not sure. I don't think that is in there. Perhaps it's reasonable to say "Maven, compile the "buildA" project and if it has any dependencies first look at the other project.xml files in this fileset to see if any other project can build that artifact. If not then go to the repository." Right now, if you use the maven:reactor does it build all projects (A, B, C, D, E) even if you only want to build A and it's dependencies, in this case B and C? I guess it still builds D and E. > -----Original Message----- > From: Hartin, Brian [mailto:[EMAIL PROTECTED] > Sent: Wednesday, October 01, 2003 2:13 PM > To: 'Maven Users List' > Subject: RE: Beginner's question about reactor > > > If I understand correctly, you're suggesting that I create > main project with no dependencies, and for the case of > project A, a 'buildA' goal in the main project's maven.xml > file. In that goal's reactor tag I would exclude projects > that A doesn't depend on. I did try this approach, but rejected it > because: > > a) A's dependency information is already in it's project XML > file. It doesn't seem right to express it yet again in a > 'fake' main project's build file. > b) If A depends on B and C, shouldn't A's build be ignorant > of what B and C depend on, and defer to their project.xml > files for that? If so, then we can't exclude anything in the > 'buildA' tag. > > I wonder if there's a way to write a maven.xml file for > project A that will build project A, and everything in its > dependency graph, in the proper order. The only problem > seems to be that Maven can't get past the fact that A has > dependencies, so the reactor never does its work. I wonder > why this is? It would seem trivial to ignore the > dependencies until after the reactor has done its thing. > > Any ideas? > > -----Original Message----- > From: Steve Garcia [mailto:[EMAIL PROTECTED] > Sent: Wednesday, October 01, 2003 3:52 PM > To: 'Maven Users List' > Subject: RE: Beginner's question about reactor > > > Hi Brian - the way I used Maven reactor is similar to the way > you have it. I have a few sub projects and the main project > is just a shell which executes the sub projects. Based on > the dependencies, the sub projects are executed in the right > order (that is so cool). > > In your case I'm not sure if you can specify more filters in > your reactor tag for includes and excludes to get only the > projects you want done. Say if you have 5 projects (A, B, C, > D, E) and project A depends on artifacts from B, and C, in > your outer maven empty project I think you can write the > maven:reactor tag to point to project A, and exclude any > project.xml's found in the path to project D and E. I > haven't tried that myself but it's worth trying. > > Hope this helps, Steve > > > -----Original Message----- > > From: Hartin, Brian [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, October 01, 2003 1:46 PM > > To: '[EMAIL PROTECTED]' > > Subject: Beginner's question about reactor > > > > > > I've just started using Maven and I'm having trouble with > > multiproject builds using reactor. Suppose I don't have a > > main project with subprojects, but rather a set of projects > > and dependencies between them, and I want to be able to build > > a particular project, recursively building its dependencies > > if necessary? The examples I've seen have all assumed that > > we have a 'main' project, with no dependencies in its > > project.xml file, and that it's got a goal in maven.xml which > > uses the reactor to build all its subprojects in the correct order. > > > > Can this be accomplished? > > > > Thanks, > > > > Brian Hartin > > NCS Pearson > > Iowa City, IA > > USA > > > > "A ship in harbor is safe, but that is not what ships are > > built for." - John Shedd > > > http://www.digitalconsumer.org/bill.html > > ************************************************************** > ************** > > This email may contain confidential material. > If you were not an intended recipient, > Please notify the sender and delete all copies. > We may monitor email to and from our network. > ************************************************************** > ************** > > --------------------------------------------------------------------- > 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] > > ************************************************************** > ************** > This email may contain confidential material. > If you were not an intended recipient, > Please notify the sender and delete all copies. > We may monitor email to and from our network. > ************************************************************** > ************** > > --------------------------------------------------------------------- > 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] **************************************************************************** This email may contain confidential material. If you were not an intended recipient, Please notify the sender and delete all copies. We may monitor email to and from our network. **************************************************************************** --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]