dev@jaxb.java.net

Re: Codemodel now builds with Maven2

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Mon, 13 Nov 2006 11:22:14 -0800

Gregory Kick wrote:
> I went ahead and merged the maven2 branch for codemodel into the
> trunk. Everything seems to work wonderfully. One other change I made
> was to put the single package.html file into the correct directory
> (.../src/main/javadoc/...), but other than that, a pretty simple
> operation.

Yay! Big thank you.

> Are there any other projects that need to be converted before JAXB?
> What's next?

I think the next one up is dtd-parser and xsom.

        http://dtd-parser.dev.java.net
        http://xsom.dev.java.net

I also realized that we need to tackle the package renaming problem for
JavaSE. The problem is like this.

When we integrate these code into JavaSE, we rename packages, so that
the copy in JavaSE's rt.jar won't interfere with the existing library
deployments that are out there (I fought hard for doing this in a
different way by using an isolation based on classloaders, but it was
shot down!)

So if you look at the dtd-parser build script, its main build is super
simple, but it has this "j2se-integration" target that does that.

The SE integration need not compile the source --- it is suffice to just
create a source tree with all the renamed source files. All the projects
are renamed in this way and have source files created, then all of them
are compiled in a big javac invocation during SE build.

So we have two options, I think.

   1. Leave the Ant build script just for the sake of doing SE
      integration. The downside is that the new comer to the project
      will get confused about whether he should be using Ant or Maven.

   2. Write a m2 plugin that does the package renaming. In this way,
      all the projects that do renaming benefits.

I'm inclined to go with 2, because there are other projects (codemodel
included) that would need this. I can provide the actual logic of doing
the package renaming, and if I understand Maven correctly, I'd just need
to put:

    @execute phase="generate-sources"

on Mojo to have the generate-sources phase run before the package
renaming work starts, right?


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com