> From: Maczka Michal [mailto:[EMAIL PROTECTED] 
> > From: Matt Read [mailto:[EMAIL PROTECTED]
> > > From: Maczka Michal [mailto:[EMAIL PROTECTED]
> > > > From: Stefanutti, Mario [mailto:[EMAIL PROTECTED]
> > > > 
> > > > Hi,
> > > > 
> > > > I looking for a way to set some common goals for each
> > > sub-project of a
> > > > multiproject environment.
> > > > 
> > > Simple soluton: create your own plugin. It is super 
> simple (example 
> > > can be found in Maven Wiki)
> > > 
> > > Michal
> > > 
> > 
> > I'm interested in this too. It appears the project's 
> inherit from the 
> > parent project's maven.xml. Even if one was to write a plugin to 
> > encapsulate common tasks they would still need to be called in the 
> > same way in each sub-project. I assume inheritance of 
> maven.xml is the 
> > recommended way to do this?
> 
> No. Plugins are recommened way of doing this. 

I don't understand. Say I've got a persistence components that requires
XDoclet to be run prior to compiling then I might do this in my maven.xml:

  <!-- Runs Xdoclet and then copies files to build directory-->  
  <preGoal name="java:compile">
    <attainGoal name="xdoclet:hibernatedoclet"/>
      <echo message="${maven.build.dest}"/>
      <copy todir="${maven.build.dest}">
        <fileset dir="${maven.xdoclet.hibernatedoclet.destdir}"/>
      </copy>   
  </preGoal>

So if I then create 2 more persistence components that need the same thing
to happen then I might recognise a duplication and refactor it out to a
plugin. However, would I still need to do the following in each of my
maven.xml's for my 3 components?

  <preGoal name="java:compile">
        <attainGoal name="myOwnPlugin:do-hibernate" />
  </preGoal>

If these components were running inside the reactor wouldn't it be better to
simply put these lines in the parent project's maven.xml?

To answer my own question, having looked at some other plugin.jelly, it
seems that I could put the same preGoal into my plugin.jelly. Is that what
you you were getting at? Sorry for being slow.

> 
> In Maven 2 inheritence uses the id of the parent project 
> instead of the relative path to parent pom
> 
> <project>
>   <parent>
>     <groupId>foo</groupId>
>     <artifactId>bba</artifactId>
>     <version>1.0</version>
>   </parent>
>   ...
> </project>
> 
> Parent pom could be taken from local repository (and hence 
> downloaded there from remote repository) and most likly it 
> might be also provided by reactor when reactor powered build 
> will be used for building both child and parent projects 
> 
> 
> We still haven't decided if maven.xml will be also 
> uploaded/downloaded to/from the repository(ies) but at the 
> moment for sake of simplicity we are rather willing to push 
> all centralized goals to plugins. Plugins can be decalred as 
> any other dependenies in poms and automatically fetched by 
> maven. It means that for common scripts - you will need to 
> create one more project.  In reactor powered builds which 
> will be  way simpler than thay are now there should be really 
> no differnce as plugin project will be build in the same run 
> of maven and made directly visible to other projets.
> 
> But this is the future :)
> 

Sounds good though!

> [..]
> 
> Michal
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to