Hi,

You should have two projects: main and sub, and I suggest you to have them
at the same level, e.g. /sub /main and in /project.xml you put the common
things. I'm against using subprojects inside of parent projects as that mess
directory layout.

Extension could be done in other way, but I think this is the more
convenient one.
You'd see the point if you'd have to share some behaviour across projects.

Regards

Carlos Sanchez
A Coru�a, Spain
http://www.jroller.com/page/carlossg/Weblog

Oness Project
http://oness.sourceforge.net


> -----Original Message-----
> From: Springer, Ian P. [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, September 21, 2004 5:51 PM
> To: Maven Users List
> Subject: RE: parent project's preGoals and postGoals being run
> 
> Carlos,
> 
> I'm confused. If a subproject's purpose is to build artifact 
> sub.jar and the main project's purpose is to build main.jar, 
> then their maven.xml's would most likely be specific to 
> building their respective jars, and so running preGoals and 
> postGoals from the parent's maven.xml during a build of 
> sub.jar would not be the desired behavior. Also, the current 
> directory will be main/sub/, not main/, wso any goals in the 
> parent maven.xml that make the  assumption paths are relative 
> to main/ will break (this is what's happening in my case btw).
> 
> I think the main point of project extension should be the 
> ability to inherit stuff from a parent POM, not to somehow 
> extend/specialize the artifact that the parent produces in 
> the subproject, as it would seem you're implying when you say 
> this behavior is desired...  
> 
> Thanks,
> Ian
> 
> | -----Original Message-----
> | From: Carlos Sanchez [mailto:[EMAIL PROTECTED]
> | Sent: Tuesday, September 21, 2004 9:58 AM
> | To: 'Maven Users List'
> | Subject: RE: parent project's preGoals and postGoals being run
> | 
> | Hi Ian,
> | 
> | You're right but that's the desired behaviour, not a bug.
> | You may do something like this in your parent:
> | <preGoal xxx>
> |   <attainGoal name="myGoal"/>
> | </preGoal xxx>
> | Where the actual code is in myGoal. Then in the subproject you can 
> | override de myGoal to do nothing.
> | 
> | 
> | Regards
> | 
> | Carlos Sanchez
> | A Coru�a, Spain
> | http://www.jroller.com/page/carlossg/Weblog
> | 
> | Oness Project
> | http://oness.sourceforge.net
> | 
> | 
> | > -----Original Message-----
> | > From: Springer, Ian P. [mailto:[EMAIL PROTECTED]
> | > Sent: Tuesday, September 21, 2004 3:41 PM
> | > To: Maven Users List
> | > Subject: parent project's preGoals and postGoals being run
> | > 
> | > 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]
> | 
> | 
> 
> ---------------------------------------------------------------------
> 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]

Reply via email to