users@jaxb.java.net

Re: Maven 2 xjc plugin - configuration settings

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Thu, 02 Mar 2006 14:46:18 -0800

Malachi de Ælfweald wrote:
> Actually.... If we were to have the args4j @Option tags on a base class
> that both referenced... Could we easily autogenerate an Ant task and Maven
> Mojo using reflection?

For simple properties like boolean, string, etc, this works just fine.
But when it gets complicated, like FileSet, or list of arguments, etc,
then I don't know if it's really all that easy.

I tried to extend args4j so that I can use the same annotated option
bean for both CLI and Ant, but I quickly found that it's not that simple
for non-trivial ant tasks (like XJC.) So I still haven't able to figure
that out yet.

But you are right that that might be another way to solve this problem.
The point of reusing the Ant syntax is primarily so that we don't have
to maintain different option parsing code. So if we can extend args4j
(or come up with something simliar) that allows us to unify
CLI/Ant/Maven, the syntax that the user uses could be very different.


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com