1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.api;
20
21 import java.util.Collection;
22 import java.util.List;
23 import java.util.stream.Stream;
24
25 import org.apache.maven.api.annotations.Experimental;
26 import org.apache.maven.api.annotations.Immutable;
27 import org.apache.maven.api.annotations.Nonnull;
28 import org.apache.maven.api.model.Plugin;
29
30
31
32
33
34
35
36
37
38
39
40
41 @Experimental
42 @Immutable
43 public interface Lifecycle extends ExtensibleEnum {
44
45
46
47
48 String CLEAN = "clean";
49 String DEFAULT = "default";
50 String SITE = "site";
51
52
53
54
55 String BEFORE = "before:";
56 String AFTER = "after:";
57 String AT = "at:";
58
59
60
61
62
63
64 @Override
65 String id();
66
67
68
69
70 Collection<Phase> phases();
71
72
73
74
75
76
77 default Collection<Phase> v3phases() {
78 return phases();
79 }
80
81
82
83
84 default Stream<Phase> allPhases() {
85 return phases().stream().flatMap(Phase::allPhases);
86 }
87
88
89
90
91 Collection<Alias> aliases();
92
93
94
95
96
97
98
99 interface Phase {
100
101
102
103
104 String ALL = "all";
105 String BUILD = "build";
106 String INITIALIZE = "initialize";
107 String VALIDATE = "validate";
108 String SOURCES = "sources";
109 String RESOURCES = "resources";
110 String COMPILE = "compile";
111 String READY = "ready";
112 String PACKAGE = "package";
113 String VERIFY = "verify";
114 String UNIT_TEST = "unit-test";
115 String TEST_SOURCES = "test-sources";
116 String TEST_RESOURCES = "test-resources";
117 String TEST_COMPILE = "test-compile";
118 String TEST = "test";
119 String INTEGRATION_TEST = "integration-test";
120 String INSTALL = "install";
121 String DEPLOY = "deploy";
122 String CLEAN = "clean";
123
124 @Nonnull
125 String name();
126
127 @Nonnull
128 List<Plugin> plugins();
129
130 @Nonnull
131 Collection<Link> links();
132
133
134
135
136 @Nonnull
137 List<Phase> phases();
138
139 @Nonnull
140 Stream<Phase> allPhases();
141 }
142
143
144
145
146
147 interface Alias {
148 String v3Phase();
149
150 String v4Phase();
151 }
152
153
154
155
156
157
158 interface Link {
159 enum Kind {
160 BEFORE,
161 AFTER
162 }
163
164 Kind kind();
165
166 Pointer pointer();
167 }
168
169 interface Pointer {
170 enum Type {
171 PROJECT,
172 DEPENDENCIES,
173 CHILDREN
174 }
175
176 String phase();
177
178 Type type();
179 }
180
181 interface PhasePointer extends Pointer {
182 default Type type() {
183 return Type.PROJECT;
184 }
185 }
186
187 interface DependenciesPointer extends Pointer {
188 String scope();
189
190 default Type type() {
191 return Type.DEPENDENCIES;
192 }
193 }
194
195 interface ChildrenPointer extends Pointer {
196 default Type type() {
197 return Type.CHILDREN;
198 }
199 }
200 }