I want to generate project documentations with the Maven site plugin. The default layout, structure and functions with "Project Information" and "Project Reports" is ok for me. But I want to add an additional (third) section "Additional Documentation", which links to some more documents, if there are such documents in the project.
I can create a directory src/site/resources/otherDocu
and the documents will be copied to the target/site/otherDocu
directory, as desired. However, the generated site does not link to them.
I would like a third section "Additional Documentation", which lists and links the files in the mentioned directory. I want to do this with as small an overhead as possible. Specifically, if it can be avoided, I do not want to include an own site.xml
, along with css etc. as described in many solutions. How can I use the default site configuration and only "inject" a part? Or, if this is the only way, it should be possible to configure a file (say site.xml
) only once in a parent POM and inherit it for all other projects. How can I make it list the files found in src/site/resources/otherDocu
and display links to them?
Or, what I also was thinking of: I could write an own report plugin, which does this, and then I only need to specify this plugin in the "reporting / plugins" section in the POM, as I did for the other reporting plugins. With this solution, I could probably create an additional entry in the "Project Reports" section, like for every other reporting plugin, which is a step in the correct direction. But I need several entries (because of several linked documents), or one entry "Additional docu" with sub-entries.
Which way is the easier to go? Does you have a recommendation or a similar solution? Does anyone have a file (site.xml
or similar) which already does some listing, does not need all other resources (images etc.) and can be inherited?
The first thing to keep the default behaviour is to use something in your site descriptor:
<body>
<menu ref="reports"/>
<menu ref="modules"/>
</body>
The thing you are using to automatically copying the files to the target is suposed for resources as you can read in the docs.
Furthermore to automatically created documents you need to go the way via a report plugin.