| ------ |
| Changing the Template File |
| ------ |
| Vincent Siveton |
| <vincent.siveton@gmail.com> |
| Maria Odea Ching |
| ------ |
| 2009-03-08 |
| ------ |
| |
| ~~ Licensed to the Apache Software Foundation (ASF) under one |
| ~~ or more contributor license agreements. See the NOTICE file |
| ~~ distributed with this work for additional information |
| ~~ regarding copyright ownership. The ASF licenses this file |
| ~~ to you under the Apache License, Version 2.0 (the |
| ~~ "License"); you may not use this file except in compliance |
| ~~ with the License. You may obtain a copy of the License at |
| ~~ |
| ~~ http://www.apache.org/licenses/LICENSE-2.0 |
| ~~ |
| ~~ Unless required by applicable law or agreed to in writing, |
| ~~ software distributed under the License is distributed on an |
| ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| ~~ KIND, either express or implied. See the License for the |
| ~~ specific language governing permissions and limitations |
| ~~ under the License. |
| |
| ~~ NOTE: For help with the syntax of this file, see: |
| ~~ http://maven.apache.org/doxia/references/apt-format.html |
| |
| |
| Changing the Template File |
| |
| It is possible to change the Velocity template used for creating the site. |
| Save your custom template in a directory of your choice and configure the |
| Site Plugin accordingly. |
| |
| <<Note:>> If you use this method then skins and the default templates, CSS |
| and images are disabled. It is therefor highly recommended that you package |
| this as a {{{./creatingskins.html}skin}} instead. |
| |
| For version 2.0-beta-5 and later you would add something like this to your |
| <<<pom.xml>>>: |
| |
| +-----+ |
| <project> |
| ... |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-site-plugin</artifactId> |
| <version>${project.version}</version> |
| <configuration> |
| <templateFile>${basedir}/maven-site.vm</templateFile> |
| </configuration> |
| </plugin> |
| </plugins> |
| </build> |
| ... |
| </project> |
| +-----+ |
| |
| For version 2.0-beta-4 and earlier it was done by adding this to your |
| <<<pom.xml>>>: |
| |
| +-----+ |
| <project> |
| ... |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-site-plugin</artifactId> |
| <version>2.0-beta-4</version> |
| <configuration> |
| <templateDirectory>${basedir}</templateDirectory> |
| <template>maven-site.vm</template> |
| </configuration> |
| </plugin> |
| </plugins> |
| </build> |
| ... |
| </project> |
| +-----+ |
| |
| Then you execute the site goal from your project: |
| |
| +-----+ |
| mvn site |
| +-----+ |
| |
| If you do not want to start from scratch you can start with the |
| {{{https://github.com/apache/maven-doxia-sitetools/blob/master/doxia-site-renderer/src/main/resources/org/apache/maven/doxia/siterenderer/resources/default-site.vm}default template}} |
| that is used by the Site Plugin. |
| |
| For more information about Velocity, see |
| {{{http://velocity.apache.org/}http://velocity.apache.org/}}. |