Stefano Bagnara ha scritto:
Stefano Bagnara ha scritto:
Hi all,
at Apache JAMES we have a product named "Mailets".
It includes a lot of classes implementing the same interface that the
user can configure in his deployment.
We currently document mailets using javadocs, but I would like to have
a more fancy web page listing all of them and providing some
information directly extracted from javadocs.
How would you approach a similar use case?
1st: if I find a way to generate xdocs from from an external tool, is
there a folder for dynamically generated xdocs that will be took by
the site plugin?
2nd: do you have any suggestion on how to generate xdocs based on src
file contents (or javadocs)?
I just realized that what I want to do is somehow similar to what you do
with maven plugins and the mojos documentation (Project Reports ->
Plugin documentation).
I guess this is automatically generated from plugin source content,
right? Where can I look to understand how it works and if this can be
reused for my use case?
After a few searches I've been able to do what I wanted to do.
I created a simple reporting maven plugin that do exactly what I need.
I based it on AbstractMavenReport and I used Qdox's JavaDocBuilder to
read javadocs from classes and an URLClassLoader created with the URLs
from getProject().getCompileClasspathElements() (I had to add
@requiresDependencyResolution compile to my Mojo).
It is easy then to use getSink() to generate the content I want using
qdox JavaClass and java reflections!
It is a bit tricky to deal with ClassLoaders but in the end it was funny.
Here is a first result after my first approach to maven mojos!
http://people.apache.org/~bago/mailet/standard/site/mailet-report.html
Here are the classes that opened my eyes:
http://svn.apache.org/repos/asf/maven/plugin-tools/trunk/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractor.java
http://svn.apache.org/repos/asf/maven/plugin-tools/trunk/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/
And this is the doc that helped starting with a report mojo:
http://docs.codehaus.org/display/MAVENUSER/Write+your+own+report+plugin
Qdox was the tool that helped me with javadocs:
http://qdox.codehaus.org/
Stefano
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]