Debian Codegraph @

doxia-integration-tools/src/site/apt/usage.apt

raw
1 ------
2 Usage
3 ------
4 Dennis Lundberg
5 Vincent Siveton
6 ------
7 2008-04-27
8 ------
9
10 ~~ Licensed to the Apache Software Foundation (ASF) under one
11 ~~ or more contributor license agreements. See the NOTICE file
12 ~~ distributed with this work for additional information
13 ~~ regarding copyright ownership. The ASF licenses this file
14 ~~ to you under the Apache License, Version 2.0 (the
15 ~~ "License"); you may not use this file except in compliance
16 ~~ with the License. You may obtain a copy of the License at
17 ~~
18 ~~ http://www.apache.org/licenses/LICENSE-2.0
19 ~~
20 ~~ Unless required by applicable law or agreed to in writing,
21 ~~ software distributed under the License is distributed on an
22 ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
23 ~~ KIND, either express or implied. See the License for the
24 ~~ specific language governing permissions and limitations
25 ~~ under the License.
26
27 ~~ NOTE: For help with the syntax of this file, see:
28 ~~ http://maven.apache.org/doxia/references/apt-format.html
29
30 Using the SiteTool in a Mojo
31
32 +-----
33 ...
34 import org.apache.maven.doxia.tools.SiteTool;
35 import org.apache.maven.plugins.annotations.Component;
36 import org.apache.maven.plugins.annotations.Mojo;
37 ...
38
39 /**
40 * Your own mojo.
41 */
42 @Mojo( name = "your-own" )
43 public class YourOwnMojo extends AbstractMojo
44 {
45 ...
46
47 /**
48 * SiteTool.
49 */
50 @Component
51 protected SiteTool siteTool;
52
53 ...
54
55 public someMethod()
56 {
57 List localesList = siteTool.getSiteLocales( locales );
58 String relativePath = siteTool.getRelativePath( "C:/foo/child",
59 "C:/foo/master" );
60 ...
61 }
62
63 ...
64 }
65 +-----
66
67 * References
68
69 [[1]] {{{./apidocs/org/apache/maven/doxia/tools/SiteTool.html}SiteTool API}}
70
71 []