1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.tools.plugin.extractor.annotations;
20
21 import java.util.List;
22
23 import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
24 import org.apache.maven.plugin.MojoExecutionException;
25 import org.apache.maven.plugins.annotations.Component;
26 import org.apache.maven.plugins.annotations.Execute;
27 import org.apache.maven.plugins.annotations.LifecyclePhase;
28 import org.apache.maven.plugins.annotations.Mojo;
29 import org.apache.maven.plugins.annotations.Parameter;
30
31
32
33
34 @Mojo(name = "foo", defaultPhase = LifecyclePhase.COMPILE, threadSafe = true)
35 @Execute(goal = "compiler", lifecycle = "my-lifecycle", phase = LifecyclePhase.PACKAGE)
36 public class FooMojo extends AbstractFooMojo {
37
38
39
40
41 @Parameter(property = "thebar", required = true, defaultValue = "coolbar")
42 protected String bar;
43
44
45
46
47 public void setBar(String bar) {
48 this.bar = bar;
49 }
50
51
52
53
54
55 @Deprecated
56 @Parameter(property = "thebeer", defaultValue = "coolbeer")
57 protected String beer;
58
59
60
61
62 private String paramFromSetter;
63
64
65
66
67 @Parameter(property = "props.paramFromSetter")
68 public void setParamFromSetter(String value) {
69 this.paramFromSetter = paramFromSetter;
70 }
71
72
73
74
75 @Parameter(property = "props.paramFromAdd")
76 public void addParamFromAdd(String value) {
77
78 }
79
80
81
82
83
84
85 @Deprecated
86 @Parameter(property = "props.paramFromSetterDeprecated")
87 public void setParamFromSetterDeprecated(List<String> value) {
88
89 }
90
91
92
93
94 @Parameter
95 public static void setStaticMethod(String value) {
96
97 }
98
99
100
101
102 @Component(role = ArtifactMetadataSource.class, hint = "maven")
103 protected ArtifactMetadataSource artifactMetadataSource;
104
105 @Override
106 public void execute() throws MojoExecutionException {
107
108 }
109
110 @Deprecated
111 public void deprecatedMethod(String value) {}
112 }