For a long time, parent maven.xml's are also run. There is already a JIRA issue for a method to disable it, however the best workaround at the moment is for your preGoal to do a conditional and check the current POM ID.
Generally, you should not use inheritence in the same way as a "master build" file - they should be separated (eg, see the maven-plugins cvs tree - plugin-parent is the root of the inheritence, while the master build file is in the TLD). On Tue, 21 Sep 2004 09:40:51 -0400, Springer, Ian P. <[EMAIL PROTECTED]> wrote: > I'm trying to set up a subproject of my main project. Unfortunately, > it's not working, because Maven is executing the preGoals and postGoals > from the parent project's maven.xml in addition to those in the > subproject's maven.xml. I added some echos to see in what order the > pre/postGoals were executing and here's what I see: > > java:compile: > [echo] subProject java:compile preGoal > [echo] mainProject java:compile preGoal > [echo] Compiling to C:\Projects\HP\ws-rp\axis-types/target/classes > [echo] subProject java:compile postGoal > [echo] mainProject java:compile postGoal > > So for any goal I run from within the subproject, Maven first executes > the subproject's pre/postGoal, then executes the parent project's > pre/postGoal. I see this behavior w/ Maven 1.0, as well as Maven 1.1 > top-of-tree. > > This seems to be a major bug to me. Stuff in the parent project > maven.xml should only be executed when you're running maven on the > parent project. Has anyone else had this issue? Does anyone know of a > workaround? > > Thanks, > Ian > > --------------------------------------------------------------------- > 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]
