Yep, good ideia.

Although I need to have this feature in multiple projects. So I could only
do this if I created a super POM that I would use as parent for all others.
I think it is best in this scenario to create a custom plugin to get the job
done with the minimal work to the users possible.

I allready started the implementation and am working on it right now.
It will decend from the maven-anrrun-plugin AbstractAntMojo class and
provide the aditional features we need.
No need for a fork, a simple inheritance will sufice.

Thanks again.

Will post the end resut here for all who care.

Regards,

On Nov 12, 2007 7:48 PM, Saloucious <[EMAIL PROTECTED]> wrote:

>
> If you have multi-projects and a parent, a easier solution, should to add
> your maven-antrun-plugin to <pluginsMagement/> tag in parent pom.xml.
>
> As far as I know you can refer in your children pom to your
> maven-antrun-plugin without redefine tasks.
>
>
>
>
>
> Pedro Viegas-2 wrote:
> >
> > Hi there,
> >
> > Thanks a bunch for your responses.
> > You pointed me in the right direction. I was wishing I could use the
> > antrun
> > plugin resources but without having to copy-paste or in other way break
> > future updates of it.
> > I'm drilling into the plugin's source right now and will post my result
> as
> > soon as I have new information.
> >
> > This plugin we're working on at my company will be open-sourced so if
> > there
> > is any interest I can post here the link to the project when we finish
> it.
> > We have yet to crerate a Maven repository in our server, but even it
> that
> > is
> > not available the Maven Generated site will have all needed information
> > including the source and package, until we publish the repository.
> >
> > Regards,
> >
> > On Nov 12, 2007 5:53 PM, Saloucious <[EMAIL PROTECTED]> wrote:
> >
> >>
> >> Just an idea
> >>
> >> May be you can fork maven-antrun-plugin, and instead of let plexus bind
> >> tasks attribute, instanciate tasks attribute with an xml file embded in
> >> you
> >> plugin artifact
> >>
> >> I was just having a look in AntRunMojo class but i think you have to
> use
> >> AntTargetConverter
> >>
> >> This is just assumptions ...
> >>
> >> Please keep me in touch
> >>
> >>
> >> Pedro Viegas-2 wrote:
> >> >
> >> > Hi there guys,
> >> >
> >> > I am trying to create a Maven plugin that executes a given ANT task
> >> inside
> >> > it.
> >> > My real case is to call the Hibernate Tools task to generate a bunch
> of
> >> > ORM
> >> > classes and Hibernate mappings.
> >> > But I need to make some decisions and have to pass some parameters to
> >> the
> >> > several Hibernate Tools tasks I need to call depending on some
> >> conditions
> >> > that I need to analize in a Java Mojo.
> >> >
> >> > Basically I need to:
> >> >
> >> >    1. Create a Mojo with some parameters and do some processing and
> >> file
> >> >    generation of my own
> >> >    2. Call the ANT Hibernate Tools tasks a bunch of times to generate
> >> all
> >> >    my classes/mapings on several packages for several database
> schemas
> >> >    3. Try to keep it as simple as possible to the end programmer
> user,
> >> >    simply call a Maven plugin and state some configuration files and
> >> >    destination package and let the conventioned behavior take charge.
> >> >
> >> > I have created the first part easily by creating a Java Maven Plugin.
> >> > The second part I have configured like a maven-ant-plugin addition to
> >> the
> >> > POM and got it working, but this has to be copied into each of the
> >> > projects
> >> > that need this goal and all the configuration I could pragmatically
> do
> >> > have
> >> > to be typed repeatedly.
> >> > So 1 and 2 are go, 3 is what I can't find any documentation or sample
> >> to
> >> > help me.
> >> >
> >> > I have seen the example from:
> >> >
> http://maven.apache.org/guides/plugin/guide-ant-plugin-development.html
> >> >
> >> > But this is how to build a maven plugin with ANT. What I need is to
> >> build
> >> > a
> >> > maven plugin in Java that can call an ant task, like antrun plugin
> does
> >> > but
> >> > adding a few more java actions and decisions before and after.
> >> >
> >> > So, how can I use the already running maven java plugin to call the
> ANT
> >> > tasks?
> >> > Can I call a plugin inside another plugin? How?
> >> > Should I try to extend the maven-antrun-plugin to try to accomplish
> >> this?
> >> >
> >> > Thanks in advance,
> >> >
> >> > --
> >> > Pedro Viegas
> >> >
> >> > ------------------------------------------------------------
> >> > Walking on water and developing software
> >> > from a specification are easy if both are
> >> > frozen.
> >> >                         - Edward V. Berard
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/How-to-create-a-Mojo-that-controls-an-ANT-task-tf4788523s177.html#a13710554
> >> Sent from the Maven - Users mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
> > --
> > Pedro Viegas
> >
> > ------------------------------------------------------------
> > Walking on water and developing software
> > from a specification are easy if both are
> > frozen.
> >                         - Edward V. Berard
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/How-to-create-a-Mojo-that-controls-an-ANT-task-tf4788523s177.html#a13712774
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Pedro Viegas

------------------------------------------------------------
Walking on water and developing software
from a specification are easy if both are
frozen.
                        - Edward V. Berard

Reply via email to