Section 3.10. Generating a Multiproject Web Site


3.10. Generating a Multiproject Web Site

Now that you know how to build all your projects, let's build a master web site containing content from all the different subprojects' web sites. Indeed, as you know, each Maven project can generate its web site by executing the Site plug-in. However, in the case of your master project, calling maven site would not aggregate the web sites from the different subprojects it is made of.

3.10.1. How do I do that?

Fortunately, the Multiproject plug-in is here to help once again. It has a goal called multiproject:site which you can use to generate this master web site. Let's run it by typing maven multiproject:site. The generated site is located in target/docs/index.html. As you can see in Figure 3-8, one of the generated pages is the project overview page, which lists the web sites for all the subprojects.

Figure 3-8. Generated multiproject web site showing the overview page


You can decide not to have an overview page if you wish, or you can customize it by playing with the following properties (the default values are shown here):

maven.multiproject.overviewPage.create=true maven.multiproject.overviewPage.title=Overview of projects maven.multiproject.overviewPage.link=projects-overview maven.multiproject.overviewPage.linkTitle=Overview of project maven.multiproject.overviewPage.text=

Note that the value of maven.multiproject.overviewPage.text would be displayed between the overview page title and the table listing the subprojects.

You can also choose to have an "independent" navigation. This means that the menu links to the different subproject will point to the URL mentioned in each project's POM url element. As a consequence, you'll also need to publish the different web sites separately (see Chapter 5 for web site deployment). You set this up by setting the maven.multiproject.navigation=independent property (it defaults to aggregate).



Maven. A Developer's Notebook
Maven: A Developers Notebook (Developers Notebooks)
ISBN: 0596007507
EAN: 2147483647
Year: 2003
Pages: 125

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net