users@jaxb.java.net

Re: Plugin development

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Mon, 18 Sep 2006 08:34:55 -0700

Aleksei Valikov wrote:
> I'd like to share my vision of the JAXB2 plugins.
>
> My feeling that we need a solid framework for JAXB plugin development.
>
> First of all, developing plugins requires a lot of utilities. You need things to
> analyze ClassOutlines or FieldOutlines, you need things to assist you with code
> creation, correctly resolve class names and many more stuff. You need your
> plugins be parameterizable from the command line - or even configured with
> Spring or other DI container.
>
> You need a testing framework. You need the ability to trace your plugin with a
> debugger to see what's happening an why does it fail. Without tracing you can
> only develop relatively simple thingss. You need the ability to test your plugin
> in the frame of automatic tests. You need the ability to tests that the
> generated code behaves as it should behave. That it's compilable. That it's stable.
>
> You need an approach to build and manage plugin projects. You need to make the
> plugins you develop usable no matter if the user invokes xjc from the command
> line, Ant or Maven.
>
> You need to manage plugin dependencies - compile time or runtime.
>
> You need all of this if you're serious.
>
> You need documentation, experience and compenetce.
>
> After all, you need promotion to let people know that your solution is out there.
>
>
> This is my vision. I am implementing in in my projects.
>
> There is a maven-jaxb2-plugin that lets you use and develop your own maven
> plugins for jaxb-based code generation.
>
> There is a maven-jaxb2-plugin-testing module which lets you execute XJC from
> your test cases. I.e. you can trace your JAXB plugins with it.
>
> (Here's some doc on that: https://maven-jaxb2-plugin.dev.java.net/docs/guide.html)
>
> hyperjaxb3-tools already implements some valuable JAXB/XJC utilities, more to come.
>
> If you think of developing a plugin, think of joining my projects. You will
> benefit from the infrastructure and experience that's out there. The community
> will benefit from innovative tools and solutions that ou develop on a solid
> basement. The solid basement will benefit from you helping it to become a solid
> basement. ;)
>
> You are welcome.

Cool. Thank you for sharing this.

I wonder if it makes sense to separate the "JAXB plugin development
support" portion (that most likely build on top of Maven) and "Maven
plugin for invoking XJC", because they really have a different audience.


With the former, you'd want things like the testing framework, the
archetype for generating a skeleton plugin, etc. It can have other
related tools and goals, like launching the current workspace (which is
a JAXB plugin) with the given set of schemas for a quick testing, etc.
It would be very nice to have a set of documents and how-tos on various
topics.

With the latter, your audience if JAXB users at general. One of the
things I'd love to see (maybe it's already there, I don't know) is that
your maven-jaxb2-plugin would take the groupId/artifactId/version of the
XJC plugins, and then the maven-jaxb2-plugin would automatically
download them from the m2 repository. Then it will become really easy to
  use a plugin, because no separate download step is necessary.

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com