dev@glassfish.java.net

maven2 directory layout questions

From: Bill Shannon <bill.shannon_at_sun.com>
Date: Tue, 13 Nov 2007 13:01:55 -0800

I'm converting the GlassFish "mail" module to the maven2 directory
layout, as specified at
http://wiki.glassfish.java.net/Wiki.jsp?page=V3WorkspaceStructure
Rather than start with the CVS version of the module, I'm starting
with the "real" master workspace, which I've migrated from Teamware
to Mercurial. Ultimately I hope to publish it as a completely
separate java.net project/module.

In addition to build the JavaMail mail.jar file, I also want to be
able to build the JavaMail release zip file, which includes the mail.jar
file, other jar files, documentation, javadocs, demo source code, etc.

I haven't learned much about maven2 yet so I have some simple questions
about the directory layout...

1. Where should I put the documentation? Is a top level "doc"
    directory ok?

2. Can I leave package.html and overview.html in the src/main/java
    directory tree?

3. Where do I put sample/demo source code? When I make a JavaMail
    release, I want to include the demo source code in the zip file.
    And I want to be able to build the demos to make sure they build
    properly before release, but the resulting class files aren't
    included in the release. Most demos are simple, standalone,
    independent applications. Should I put them all in src/demo/java?
    Do I need a different directory under src for each one?

 From the same set of sources I build multiple jar files with
different combinations of sources. Each jar file needs its
own manifest and its own resource files. The manifest files
need to be preprocessed to (e.g.) fill in the correct version
number before use.

4. Should I put all these manifest and resource files under
    src/main/resources?

5. Is there a way to preprocess these files before use, including
    changing their names? Or do the things in src/main/resources
    just get copied with no processing?

I'm sure I'll have more questions once I start figuring out how
to actually use maven2 to build my module...

Thanks!