1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
package org.apache.tiles.autotag.plugin; |
22 | |
|
23 | |
import java.util.Map; |
24 | |
|
25 | |
import org.apache.maven.plugins.annotations.LifecyclePhase; |
26 | |
import org.apache.maven.plugins.annotations.Mojo; |
27 | |
import org.apache.maven.plugins.annotations.Parameter; |
28 | |
import org.apache.maven.plugins.annotations.ResolutionScope; |
29 | |
import org.apache.tiles.autotag.freemarker.FMTemplateGeneratorFactory; |
30 | |
import org.apache.tiles.autotag.generate.TemplateGeneratorBuilder; |
31 | |
import org.apache.tiles.autotag.generate.TemplateGeneratorFactory; |
32 | |
import org.apache.velocity.app.VelocityEngine; |
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
@Mojo( |
38 | |
name = "generate-freemarker", |
39 | |
defaultPhase = LifecyclePhase.GENERATE_SOURCES, |
40 | |
requiresDependencyResolution = ResolutionScope.COMPILE) |
41 | 2 | public class GenerateFreemarkerMojo extends AbstractGenerateMojo { |
42 | |
|
43 | |
|
44 | |
|
45 | |
|
46 | |
@Parameter(defaultValue = "org.apache.tiles.autotag.freemarker.runtime.Runtime", required = true) |
47 | |
String freemarkerRuntime; |
48 | |
|
49 | |
|
50 | |
@Override |
51 | |
protected Map<String, String> getParameters() { |
52 | 1 | return null; |
53 | |
} |
54 | |
|
55 | |
|
56 | |
@Override |
57 | |
protected String getRuntimeClass() { |
58 | 0 | return freemarkerRuntime; |
59 | |
} |
60 | |
|
61 | |
@Override |
62 | |
protected TemplateGeneratorFactory createTemplateGeneratorFactory( |
63 | |
VelocityEngine velocityEngine) { |
64 | 1 | return new FMTemplateGeneratorFactory(classesOutputLocator, |
65 | |
velocityEngine, TemplateGeneratorBuilder.createNewInstance()); |
66 | |
} |
67 | |
} |