Inline...
On 5/18/06, Jonathan Johnson <jonjohnson_at_mail.com> wrote:
>
> Malachi –
>
>
>
> I think all we need in the configuration is…
>
>
> <classpaths>
> <classpath>/path/to/jaxb-xjc.jar</classpath>
> <classpath>/path/to/plugin.jar</classpath>
> </classpaths >
>
> and
>
>
>
> <extensions>
> <extension>locator</extension>
> </extensions>
>
I agree.
My only question is how to pass this information to XJC2Task? XJC2Task has
> a setClasspath method so I will just take all the classpath settings and put
> them into a long classpath string (separated with ';' or ':'). But, I
> don't see how to pass the name of the plugin invocation method to the
> XJC2Task class. There does not seem to be a public method for this.
> Perhaps
>
I'm not sure. I never use the XJC2Task. I used Driver.run since it took the
same parameters as xjc.bat
Kohsuke knows.
>
>
>
> There is no need for a enabled="true" attribute since the absence or
> presence of a list will determine this state..
>
What if they want to enable "extension" mode but NOT provide a list of
vendor extensions (sometimes necessary depending on what they put into the
XSD/XJB)
Passing the classpath to the plugin does not seem too bad to me. Its just a
> little odd since all the jars are typically in the repository yet these jaxb
> plugins would be in the module source – that does mike it a little strange,
> but it should work. I'm
>
well, let's think about this for a second... would the hibernate plugin be
in module source? while it would be nice to have it autogenerate my
extension during the build, I don't think we can assume you aren't going to
just download a jaxb plugin... but maybe it would be a good practice to
require that people just add their extensions to the repository and add them
as dependencies.... hmm... how easy could we make that?
not sure what the XJC2Task does with the classpath, but what if we could
> just add the jaxb plugin to the maven pom dependency list and just called
> the plugin invocation method? That would be nice so the jaxb plugin could
> be published to the repository and it would follow the maven approach. We
> could avoid the classpath setting entirely. (Kohsuke - thoughts?)
>
I don't think we need to invoke the plugin, because XJC should do that
behind the scenes when we pass in the "-pluginName"... realistically, it
shouldn't take any more work to add their plugin to the classpath than
adding the activation or mail jars, right?
What else is needed? Does the invocation method ever take a parameter list?
> Do the plugins inherit the XJC2Task logging mechanism?
>
XJC should call the run method on the plugin... the logging is a different
matter... on mine, I explicitely set it from my plugin... it didn't appear
to handle it on its own... but maybe if we add a 'public void setLogger(
org.apache.maven.plugin.logging.Log logger)' to Plugin itself, everyone's
existing plugins would inherit the new functionality?
Malachi