2.11. Using the FAQ Plug-inMany projects contain pages full of frequently asked questions, which provide insight to everything from the reason why a particular project was started to how one can fix common technical problems. The Maven FAQ plug-in is a useful tool for creating such a page. 2.11.1. How do I do that?To use the FAQ plug-in, list the plug-in in your project.xml reports element as follows: <reports> <report>maven-faq-plugin</report> </reports> Now that you have the report activated, create the xdocs/faq.fml file with the following content: Note: The reports element is not additive. If you specify only one report in this element, only one report is generated. You'll need to list all the reports you want explicitly in the reports element. <?xml version="1.0" encoding="UTF-8"?> <faqs title="Frequently Asked Questions"> <part > <title>General</title> <faq > <question> What is the Weather project? </question> <answer> <p> The Weather project is an example from the Maven Developer's Notebook. It is an attempt to demonstrate simple Maven customization techniques with a project that isn't going to bore the reader to death. </p> </answer> </faq> <faq > <question> Why did you choose the Axis plug-in? </question> <answer> <p> The Axis plug-in was selected because it happens to be a useful and complex tool that is easy to introduce. </p> </answer> </faq> </part> <part > <title>Installation</title> <faq > <question> How do I install Weather? </question> <answer> <p>Simple, check it out of Subversion, and run maven wsdl2java.</p> </answer> </faq> </part> </faqs> Now, generate the site with maven site, and load target/docs/index.html in a browser. If you click Project Reports and FAQs, you should see the page shown in Figure 2-3. Figure 2-3. A sample Maven FAQ report2.11.2. What just happened?You activated the FAQ plug-in by listing it in project.xml's reports element. Then you wrote an XML document containing a series of frequently asked questions. When you generated the site, this FAQ was transformed into a web page, and linked from the Project Reports submenu. |