views:

19

answers:

1

In my parent project I have a site.xml (referencing a logo) and some resources:

src/site/resources/images/logo.gif src/site/resources/css/our.css

How do I make them available to all the children? The site.xml specifies the logo url as images/logo.gif but the file is not there when the child site is generated?

+1  A: 

Maven only inherits the site descriptor. You will need to use URLs that have knowledge of the relative path (or an appropriate absolute path) to reference the deployed location of the resources from the parent.

This makes it hard to preview the site, however, as the filesystem structure of the child modules, including target/site doesn't match the layout on the final site. In this case, you can use mvn site:stage to preview it in the consolidated layout.

Finally, if you are in need of copying these resources to several different sites (children or otherwise), you should create a skin. You can find documentation here: http://maven.apache.org/plugins/maven-site-plugin/examples/creatingskins.html or a practical example here: http://github.com/brettporter/centrepoint/tree/master/centrepoint/

Brett Porter