Skip to Main Content
Maven: The Definitive Guide
book

Maven: The Definitive Guide

by Sonatype Company
September 2008
Intermediate to advanced content levelIntermediate to advanced
470 pages
14h 22m
English
O'Reilly Media, Inc.
Content preview from Maven: The Definitive Guide

Tips and Tricks

This section lists some useful tips and tricks you can use when creating a Maven site.

Inject XHTML into HEAD

To inject XHTML into the HEAD element, add a head element to the body element in your project’s Site descriptor. Example 15-13 adds a feed link to every page in the sample-project web site.

Example 15-13. Injecting HTML into the HEAD element

<project name="Hello World">
  ...
  <body>
    <head>
      <link href="http://sample.com/sites/sample-project/feeds/blog"
            type="application/atom+xml" 
            id="auto-discovery" 
            rel="alternate" 
            title="Sample Project Blog" />
    </head>
    ...
  </body>
</project>

Add Links Under Your Site Logo

If you are working on a project that is being developed by an organization, you may want to add links under your project’s logo. Assuming that your project is a part of the Apache Software Foundation, you might want to add a link to the Apache Software Foundation web site right below your logo, and you might want to add a link to a parent project as well. To add links below your site logo, just add a links element to the body element in the Site descriptor. Each item element in the links element will be rendered as a link in a bar directly below your project’s logo. Example 15-14 will add a link to the Apache Software Foundation followed by a link to the Apache Maven project.

Example 15-14. Adding links under your site logo

<project name="Hello World"> ... <body> ... <links> <item name="Apache" href="http://www.apache.org"/> <item name="Maven" href="http://maven.apache.org"/> ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Apache Maven Cookbook

Apache Maven Cookbook

Raghuram Bharathan
Mastering Apache Maven 3

Mastering Apache Maven 3

Prabath Siriwardena
Learning Apache Maven

Learning Apache Maven

Kevin Bowersox

Publisher Resources

ISBN: 9780596517335Supplemental ContentErrata Page