Hi Ashley, comments inline. Cheers, -- Chris On 9/15/05, Ashley Williams <[EMAIL PROTECTED]> wrote: > (Chris) > > Pleased to see fellow users steering Maven more in the direction of > ant and I have a few questions about this new plugin. > > 1. I'm concerned that I have to write java code in order to call ant > tasks. For example to support the tomcat task, would I or somebody > else have to have extended the antfile plugin?
The Java code is trivial. The real work is all handled by an abstract class. The reason we have to have to write a bit of Java is because a) m2, at least currently, has no way to do "annotation-based pulls of POM <configuration> properties" in any but the base class -- when these classes are in separate jars. b) But even if it could, you will still need to pull these properties and pass them on to Ant. That's' pretty much all that the Java code does. (although, yes, I think this could maybe be generalized when (a) is fixed) c) We want reusable Plugins. (E.g. I have an Axis plugin that I use in many projects.) This plugin contains it's Ant buildfile (e.g. axis-build.xml), and needs to have a Mojo associated with it (AFAIK). There are specifics to each AntFile usage such as what target to call, the name of the buildfile (it cannot be build.xml because it will likely clash with other AntFile uses), and properties (with defaults). IMO, this is not necessarily a Bad Thing. > 2. Is this a stop gap plugin until John 'persuades' ;) his client to > let him reuse some wrapper archetecture to dynamically create ant > property delegates - or does it achieve something slightly different? Again, I think for reuasability you will want to have specific plugins which handle chunks of your build, which have to be layered into the m2 phases. So you might have an Ant-based build that you're converting to m2. Let's assume that ~80% is directly convertible to m2, and there are, say, 2 things that are specific to your needs-- at, say, 2 different phases of the Ant build. These should be pulled into 2 m2 plugins that you layer into the general m2 sequence. It is my experience that if you need some ability in one build, you will likely need it in your next build. They are typically "company build policy" and not build-specific > 3. Are you talking about invoking isolated ant tasks or whole ant > build files or both? Are you suggesting that ant basically becomes > another plugin language encapsulated in its own build file - could be > very useful. Absolutely. I would like to see m2 embrace Ant as a "plugin language" -- perhaps as it's primary extension language. IMO, m2 would get tremendous adoption if it took this stance. I have no desire to reinvent everything that Ant already does. And, as we all know, it is pretty easy to scrounge up Ant Tasks that do whatever you're after somewhere on the Net. So why recode it and debug it. Either programmatically build the Tasks in your Mojo (which can get a little long-winded) -- or just use a buildfile... > > I'd definitely welcome the option to embed ant tasks directly within > a pom, preserving the exact same ant syntax, like I think antrun does > - only benefiting from automatic maven properties and invoked in the > same jvm as discussed a while ago. Agreed. But this is isolated to that POM, so it's useful, but not reusable. There will be cases where this makes the most sense, and case where reusability is important. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
