Hi Pedro,

I faced a similar task and it took a while to find a plugin invoking ANT within a Maven build - unfortunately I can't remember what plugin I looked at (oehaus?!) but I copy&wasted to code for my Canoo WebTest plugin

http://people.apache.org/~sgoeschl/download/maven-plugins/

The code uses an AntExecutor which does the trick

Cheers,

Siegfried Goeschl


Pedro Viegas 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,


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

Reply via email to