1 // =================== DO NOT EDIT THIS FILE ====================
2 // Generated by Modello Velocity from model.vm
3 // template, any modifications will be overwritten.
4 // ==============================================================
5 package org.apache.maven.api.plugin.descriptor;
6
7 import java.io.Serializable;
8 import java.util.ArrayList;
9 import java.util.Collection;
10 import java.util.Collections;
11 import java.util.HashMap;
12 import java.util.List;
13 import java.util.Map;
14 import org.apache.maven.api.annotations.Experimental;
15 import org.apache.maven.api.annotations.Generated;
16 import org.apache.maven.api.annotations.Immutable;
17 import org.apache.maven.api.annotations.Nonnull;
18 import org.apache.maven.api.annotations.NotThreadSafe;
19 import org.apache.maven.api.annotations.ThreadSafe;
20
21 /**
22 * A Mojo description.
23 */
24 @Experimental
25 @Generated @ThreadSafe @Immutable
26 public class MojoDescriptor
27 implements Serializable
28 {
29 /**
30 * The goal name for the Mojo, that users will reference from the command line to execute the Mojo directly,
31 * or inside a POM in order to provide Mojo-specific configuration.
32 */
33 final String goal;
34 /**
35 * The description of this Mojo's functionality.
36 */
37 final String description;
38 /**
39 * The Mojo's fully-qualified class name (or script path in the case of non-Java Mojos).
40 */
41 final String implementation;
42 /**
43 * The implementation language for this Mojo (java, beanshell, etc.).
44 */
45 final String language;
46 /**
47 * Defines a default phase to bind a Mojo execution to if the user does not explicitly set a phase in the POM.
48 * <i>Note:</i> This will not automagically make a Mojo run when the plugin declaration is added
49 * to the POM. It merely enables the user to omit the <code><phase></code> element from the
50 * surrounding <code><execution></code> element.
51 */
52 final String phase;
53 /**
54 * Reference the invocation phase of the Mojo.
55 */
56 final String executePhase;
57 /**
58 * Reference the invocation goal of the Mojo.
59 */
60 final String executeGoal;
61 /**
62 *
63 */
64 final String executeLifecycle;
65 /**
66 * Flags this Mojo as requiring the dependencies in the specified class path to be resolved before it can
67 * execute: <code>compile</code>, <code>runtime</code>, <code>test</code>,
68 * <code>compile+runtime</code> (since Maven 3.0) or <code>runtime+system</code> (since Maven 3.0)
69 */
70 final String dependencyResolution;
71 /**
72 * Flags this Mojo as requiring information about the dependencies that would make up the specified class
73 * path. As the name suggests, this is similar to requiresDependencyResolution and supports the same values.
74 * The important difference is this will not resolve the files for the dependencies, i.e. the artifacts
75 * associated with a Maven project can lack a file. As such, this annotation is meant for Mojos that only
76 * want to analyze the set of transitive dependencies, in particular during early lifecycle phases where
77 * full dependency resolution might fail due to projects which haven't been built yet.
78 */
79 final String dependencyCollection;
80 /**
81 * Flags this Mojo to be invoked directly only.
82 */
83 final boolean directInvocationOnly;
84 /**
85 * Flags this Mojo to require running inside of a project.
86 */
87 final boolean projectRequired;
88 /**
89 * Flags this Mojo to require online mode for its operation.
90 */
91 final boolean onlineRequired;
92 /**
93 * Flags this Mojo to run it in a multi-module way, i.e. aggregate the build with the set of projects
94 * listed as modules.
95 */
96 final boolean aggregator;
97 /**
98 * Specify that the Mojo is inherited.
99 */
100 final boolean inheritedByDefault;
101 /**
102 * Specify the version when the Mojo was added to the API. Similar to Javadoc since.
103 */
104 final String since;
105 /**
106 * Description with the reason of Mojo deprecation. Similar to Javadoc <code>@deprecated</code>
107 * This will trigger a warning when a user tries to use a Mojo marked as deprecated.
108 */
109 final String deprecated;
110 /**
111 * The configurator type to use when injecting parameter values into this Mojo. The value is normally deduced
112 * from the Mojo's implementation language, but can be specified to allow a custom ComponentConfigurator
113 * implementation to be used.
114 */
115 final String configurator;
116 /**
117 *
118 */
119 final List<Parameter> parameters;
120 /**
121 * the id of the mojo, based on the goal name
122 */
123 final String id;
124 /**
125 * the full goal name
126 */
127 final String fullGoalName;
128
129 /**
130 * Constructor for this class, package protected.
131 * @see Builder#build()
132 */
133 MojoDescriptor(
134 String goal,
135 String description,
136 String implementation,
137 String language,
138 String phase,
139 String executePhase,
140 String executeGoal,
141 String executeLifecycle,
142 String dependencyResolution,
143 String dependencyCollection,
144 boolean directInvocationOnly,
145 boolean projectRequired,
146 boolean onlineRequired,
147 boolean aggregator,
148 boolean inheritedByDefault,
149 String since,
150 String deprecated,
151 String configurator,
152 Collection<Parameter> parameters,
153 String id,
154 String fullGoalName
155 ) {
156 this.goal = goal;
157 this.description = description;
158 this.implementation = implementation;
159 this.language = language;
160 this.phase = phase;
161 this.executePhase = executePhase;
162 this.executeGoal = executeGoal;
163 this.executeLifecycle = executeLifecycle;
164 this.dependencyResolution = dependencyResolution;
165 this.dependencyCollection = dependencyCollection;
166 this.directInvocationOnly = directInvocationOnly;
167 this.projectRequired = projectRequired;
168 this.onlineRequired = onlineRequired;
169 this.aggregator = aggregator;
170 this.inheritedByDefault = inheritedByDefault;
171 this.since = since;
172 this.deprecated = deprecated;
173 this.configurator = configurator;
174 this.parameters = ImmutableCollections.copy(parameters);
175 this.id = id;
176 this.fullGoalName = fullGoalName;
177 }
178
179 /**
180 * The goal name for the Mojo, that users will reference from the command line to execute the Mojo directly,
181 * or inside a POM in order to provide Mojo-specific configuration.
182 *
183 * @return a {@code String}
184 */
185 public String getGoal() {
186 return this.goal;
187 }
188
189 /**
190 * The description of this Mojo's functionality.
191 *
192 * @return a {@code String}
193 */
194 public String getDescription() {
195 return this.description;
196 }
197
198 /**
199 * The Mojo's fully-qualified class name (or script path in the case of non-Java Mojos).
200 *
201 * @return a {@code String}
202 */
203 public String getImplementation() {
204 return this.implementation;
205 }
206
207 /**
208 * The implementation language for this Mojo (java, beanshell, etc.).
209 *
210 * @return a {@code String}
211 */
212 public String getLanguage() {
213 return this.language;
214 }
215
216 /**
217 * Defines a default phase to bind a Mojo execution to if the user does not explicitly set a phase in the POM.
218 * <i>Note:</i> This will not automagically make a Mojo run when the plugin declaration is added
219 * to the POM. It merely enables the user to omit the <code><phase></code> element from the
220 * surrounding <code><execution></code> element.
221 *
222 * @return a {@code String}
223 */
224 public String getPhase() {
225 return this.phase;
226 }
227
228 /**
229 * Reference the invocation phase of the Mojo.
230 *
231 * @return a {@code String}
232 */
233 public String getExecutePhase() {
234 return this.executePhase;
235 }
236
237 /**
238 * Reference the invocation goal of the Mojo.
239 *
240 * @return a {@code String}
241 */
242 public String getExecuteGoal() {
243 return this.executeGoal;
244 }
245
246 /**
247 *
248 *
249 * @return a {@code String}
250 */
251 public String getExecuteLifecycle() {
252 return this.executeLifecycle;
253 }
254
255 /**
256 * Flags this Mojo as requiring the dependencies in the specified class path to be resolved before it can
257 * execute: <code>compile</code>, <code>runtime</code>, <code>test</code>,
258 * <code>compile+runtime</code> (since Maven 3.0) or <code>runtime+system</code> (since Maven 3.0)
259 *
260 * @return a {@code String}
261 */
262 public String getDependencyResolution() {
263 return this.dependencyResolution;
264 }
265
266 /**
267 * Flags this Mojo as requiring information about the dependencies that would make up the specified class
268 * path. As the name suggests, this is similar to requiresDependencyResolution and supports the same values.
269 * The important difference is this will not resolve the files for the dependencies, i.e. the artifacts
270 * associated with a Maven project can lack a file. As such, this annotation is meant for Mojos that only
271 * want to analyze the set of transitive dependencies, in particular during early lifecycle phases where
272 * full dependency resolution might fail due to projects which haven't been built yet.
273 *
274 * @return a {@code String}
275 */
276 public String getDependencyCollection() {
277 return this.dependencyCollection;
278 }
279
280 /**
281 * Flags this Mojo to be invoked directly only.
282 *
283 * @return a {@code boolean}
284 */
285 public boolean isDirectInvocationOnly() {
286 return this.directInvocationOnly;
287 }
288
289 /**
290 * Flags this Mojo to require running inside of a project.
291 *
292 * @return a {@code boolean}
293 */
294 public boolean isProjectRequired() {
295 return this.projectRequired;
296 }
297
298 /**
299 * Flags this Mojo to require online mode for its operation.
300 *
301 * @return a {@code boolean}
302 */
303 public boolean isOnlineRequired() {
304 return this.onlineRequired;
305 }
306
307 /**
308 * Flags this Mojo to run it in a multi-module way, i.e. aggregate the build with the set of projects
309 * listed as modules.
310 *
311 * @return a {@code boolean}
312 */
313 public boolean isAggregator() {
314 return this.aggregator;
315 }
316
317 /**
318 * Specify that the Mojo is inherited.
319 *
320 * @return a {@code boolean}
321 */
322 public boolean isInheritedByDefault() {
323 return this.inheritedByDefault;
324 }
325
326 /**
327 * Specify the version when the Mojo was added to the API. Similar to Javadoc since.
328 *
329 * @return a {@code String}
330 */
331 public String getSince() {
332 return this.since;
333 }
334
335 /**
336 * Description with the reason of Mojo deprecation. Similar to Javadoc <code>@deprecated</code>
337 * This will trigger a warning when a user tries to use a Mojo marked as deprecated.
338 *
339 * @return a {@code String}
340 */
341 public String getDeprecated() {
342 return this.deprecated;
343 }
344
345 /**
346 * The configurator type to use when injecting parameter values into this Mojo. The value is normally deduced
347 * from the Mojo's implementation language, but can be specified to allow a custom ComponentConfigurator
348 * implementation to be used.
349 *
350 * @return a {@code String}
351 */
352 public String getConfigurator() {
353 return this.configurator;
354 }
355
356 /**
357 *
358 *
359 * @return a {@code List<Parameter>}
360 */
361 @Nonnull
362 public List<Parameter> getParameters() {
363 return this.parameters;
364 }
365
366 /**
367 * the id of the mojo, based on the goal name
368 *
369 * @return a {@code String}
370 */
371 public String getId() {
372 return this.id;
373 }
374
375 /**
376 * the full goal name
377 *
378 * @return a {@code String}
379 */
380 public String getFullGoalName() {
381 return this.fullGoalName;
382 }
383
384 /**
385 * Creates a new builder with this object as the basis.
386 *
387 * @return a {@code Builder}
388 */
389 @Nonnull
390 public Builder with() {
391 return newBuilder(this);
392 }
393 /**
394 * Creates a new {@code MojoDescriptor} instance using the specified goal.
395 *
396 * @param goal the new {@code String} to use
397 * @return a {@code MojoDescriptor} with the specified goal
398 */
399 @Nonnull
400 public MojoDescriptor withGoal(String goal) {
401 return newBuilder(this, true).goal(goal).build();
402 }
403 /**
404 * Creates a new {@code MojoDescriptor} instance using the specified description.
405 *
406 * @param description the new {@code String} to use
407 * @return a {@code MojoDescriptor} with the specified description
408 */
409 @Nonnull
410 public MojoDescriptor withDescription(String description) {
411 return newBuilder(this, true).description(description).build();
412 }
413 /**
414 * Creates a new {@code MojoDescriptor} instance using the specified implementation.
415 *
416 * @param implementation the new {@code String} to use
417 * @return a {@code MojoDescriptor} with the specified implementation
418 */
419 @Nonnull
420 public MojoDescriptor withImplementation(String implementation) {
421 return newBuilder(this, true).implementation(implementation).build();
422 }
423 /**
424 * Creates a new {@code MojoDescriptor} instance using the specified language.
425 *
426 * @param language the new {@code String} to use
427 * @return a {@code MojoDescriptor} with the specified language
428 */
429 @Nonnull
430 public MojoDescriptor withLanguage(String language) {
431 return newBuilder(this, true).language(language).build();
432 }
433 /**
434 * Creates a new {@code MojoDescriptor} instance using the specified phase.
435 *
436 * @param phase the new {@code String} to use
437 * @return a {@code MojoDescriptor} with the specified phase
438 */
439 @Nonnull
440 public MojoDescriptor withPhase(String phase) {
441 return newBuilder(this, true).phase(phase).build();
442 }
443 /**
444 * Creates a new {@code MojoDescriptor} instance using the specified executePhase.
445 *
446 * @param executePhase the new {@code String} to use
447 * @return a {@code MojoDescriptor} with the specified executePhase
448 */
449 @Nonnull
450 public MojoDescriptor withExecutePhase(String executePhase) {
451 return newBuilder(this, true).executePhase(executePhase).build();
452 }
453 /**
454 * Creates a new {@code MojoDescriptor} instance using the specified executeGoal.
455 *
456 * @param executeGoal the new {@code String} to use
457 * @return a {@code MojoDescriptor} with the specified executeGoal
458 */
459 @Nonnull
460 public MojoDescriptor withExecuteGoal(String executeGoal) {
461 return newBuilder(this, true).executeGoal(executeGoal).build();
462 }
463 /**
464 * Creates a new {@code MojoDescriptor} instance using the specified executeLifecycle.
465 *
466 * @param executeLifecycle the new {@code String} to use
467 * @return a {@code MojoDescriptor} with the specified executeLifecycle
468 */
469 @Nonnull
470 public MojoDescriptor withExecuteLifecycle(String executeLifecycle) {
471 return newBuilder(this, true).executeLifecycle(executeLifecycle).build();
472 }
473 /**
474 * Creates a new {@code MojoDescriptor} instance using the specified dependencyResolution.
475 *
476 * @param dependencyResolution the new {@code String} to use
477 * @return a {@code MojoDescriptor} with the specified dependencyResolution
478 */
479 @Nonnull
480 public MojoDescriptor withDependencyResolution(String dependencyResolution) {
481 return newBuilder(this, true).dependencyResolution(dependencyResolution).build();
482 }
483 /**
484 * Creates a new {@code MojoDescriptor} instance using the specified dependencyCollection.
485 *
486 * @param dependencyCollection the new {@code String} to use
487 * @return a {@code MojoDescriptor} with the specified dependencyCollection
488 */
489 @Nonnull
490 public MojoDescriptor withDependencyCollection(String dependencyCollection) {
491 return newBuilder(this, true).dependencyCollection(dependencyCollection).build();
492 }
493 /**
494 * Creates a new {@code MojoDescriptor} instance using the specified directInvocationOnly.
495 *
496 * @param directInvocationOnly the new {@code boolean} to use
497 * @return a {@code MojoDescriptor} with the specified directInvocationOnly
498 */
499 @Nonnull
500 public MojoDescriptor withDirectInvocationOnly(boolean directInvocationOnly) {
501 return newBuilder(this, true).directInvocationOnly(directInvocationOnly).build();
502 }
503 /**
504 * Creates a new {@code MojoDescriptor} instance using the specified projectRequired.
505 *
506 * @param projectRequired the new {@code boolean} to use
507 * @return a {@code MojoDescriptor} with the specified projectRequired
508 */
509 @Nonnull
510 public MojoDescriptor withProjectRequired(boolean projectRequired) {
511 return newBuilder(this, true).projectRequired(projectRequired).build();
512 }
513 /**
514 * Creates a new {@code MojoDescriptor} instance using the specified onlineRequired.
515 *
516 * @param onlineRequired the new {@code boolean} to use
517 * @return a {@code MojoDescriptor} with the specified onlineRequired
518 */
519 @Nonnull
520 public MojoDescriptor withOnlineRequired(boolean onlineRequired) {
521 return newBuilder(this, true).onlineRequired(onlineRequired).build();
522 }
523 /**
524 * Creates a new {@code MojoDescriptor} instance using the specified aggregator.
525 *
526 * @param aggregator the new {@code boolean} to use
527 * @return a {@code MojoDescriptor} with the specified aggregator
528 */
529 @Nonnull
530 public MojoDescriptor withAggregator(boolean aggregator) {
531 return newBuilder(this, true).aggregator(aggregator).build();
532 }
533 /**
534 * Creates a new {@code MojoDescriptor} instance using the specified inheritedByDefault.
535 *
536 * @param inheritedByDefault the new {@code boolean} to use
537 * @return a {@code MojoDescriptor} with the specified inheritedByDefault
538 */
539 @Nonnull
540 public MojoDescriptor withInheritedByDefault(boolean inheritedByDefault) {
541 return newBuilder(this, true).inheritedByDefault(inheritedByDefault).build();
542 }
543 /**
544 * Creates a new {@code MojoDescriptor} instance using the specified since.
545 *
546 * @param since the new {@code String} to use
547 * @return a {@code MojoDescriptor} with the specified since
548 */
549 @Nonnull
550 public MojoDescriptor withSince(String since) {
551 return newBuilder(this, true).since(since).build();
552 }
553 /**
554 * Creates a new {@code MojoDescriptor} instance using the specified deprecated.
555 *
556 * @param deprecated the new {@code String} to use
557 * @return a {@code MojoDescriptor} with the specified deprecated
558 */
559 @Nonnull
560 public MojoDescriptor withDeprecated(String deprecated) {
561 return newBuilder(this, true).deprecated(deprecated).build();
562 }
563 /**
564 * Creates a new {@code MojoDescriptor} instance using the specified configurator.
565 *
566 * @param configurator the new {@code String} to use
567 * @return a {@code MojoDescriptor} with the specified configurator
568 */
569 @Nonnull
570 public MojoDescriptor withConfigurator(String configurator) {
571 return newBuilder(this, true).configurator(configurator).build();
572 }
573 /**
574 * Creates a new {@code MojoDescriptor} instance using the specified parameters.
575 *
576 * @param parameters the new {@code Collection<Parameter>} to use
577 * @return a {@code MojoDescriptor} with the specified parameters
578 */
579 @Nonnull
580 public MojoDescriptor withParameters(Collection<Parameter> parameters) {
581 return newBuilder(this, true).parameters(parameters).build();
582 }
583 /**
584 * Creates a new {@code MojoDescriptor} instance using the specified id.
585 *
586 * @param id the new {@code String} to use
587 * @return a {@code MojoDescriptor} with the specified id
588 */
589 @Nonnull
590 public MojoDescriptor withId(String id) {
591 return newBuilder(this, true).id(id).build();
592 }
593 /**
594 * Creates a new {@code MojoDescriptor} instance using the specified fullGoalName.
595 *
596 * @param fullGoalName the new {@code String} to use
597 * @return a {@code MojoDescriptor} with the specified fullGoalName
598 */
599 @Nonnull
600 public MojoDescriptor withFullGoalName(String fullGoalName) {
601 return newBuilder(this, true).fullGoalName(fullGoalName).build();
602 }
603
604 /**
605 * Creates a new {@code MojoDescriptor} instance.
606 * Equivalent to {@code newInstance(true)}.
607 * @see #newInstance(boolean)
608 *
609 * @return a new {@code MojoDescriptor}
610 */
611 @Nonnull
612 public static MojoDescriptor newInstance() {
613 return newInstance(true);
614 }
615
616 /**
617 * Creates a new {@code MojoDescriptor} instance using default values or not.
618 * Equivalent to {@code newBuilder(withDefaults).build()}.
619 *
620 * @param withDefaults the boolean indicating whether default values should be used
621 * @return a new {@code MojoDescriptor}
622 */
623 @Nonnull
624 public static MojoDescriptor newInstance(boolean withDefaults) {
625 return newBuilder(withDefaults).build();
626 }
627
628 /**
629 * Creates a new {@code MojoDescriptor} builder instance.
630 * Equivalent to {@code newBuilder(true)}.
631 * @see #newBuilder(boolean)
632 *
633 * @return a new {@code Builder}
634 */
635 @Nonnull
636 public static Builder newBuilder() {
637 return newBuilder(true);
638 }
639
640 /**
641 * Creates a new {@code MojoDescriptor} builder instance using default values or not.
642 *
643 * @param withDefaults the boolean indicating whether default values should be used
644 * @return a new {@code Builder}
645 */
646 @Nonnull
647 public static Builder newBuilder(boolean withDefaults) {
648 return new Builder(withDefaults);
649 }
650
651 /**
652 * Creates a new {@code MojoDescriptor} builder instance using the specified object as a basis.
653 * Equivalent to {@code newBuilder(from, false)}.
654 *
655 * @param from the {@code MojoDescriptor} instance to use as a basis
656 * @return a new {@code Builder}
657 */
658 @Nonnull
659 public static Builder newBuilder(MojoDescriptor from) {
660 return newBuilder(from, false);
661 }
662
663 /**
664 * Creates a new {@code MojoDescriptor} builder instance using the specified object as a basis.
665 *
666 * @param from the {@code MojoDescriptor} instance to use as a basis
667 * @param forceCopy the boolean indicating if a copy should be forced
668 * @return a new {@code Builder}
669 */
670 @Nonnull
671 public static Builder newBuilder(MojoDescriptor from, boolean forceCopy) {
672 return new Builder(from, forceCopy);
673 }
674
675 /**
676 * Builder class used to create MojoDescriptor instances.
677 * @see #with()
678 * @see #newBuilder()
679 */
680 @NotThreadSafe
681 public static class Builder
682 {
683 MojoDescriptor base;
684 String goal;
685 String description;
686 String implementation;
687 String language;
688 String phase;
689 String executePhase;
690 String executeGoal;
691 String executeLifecycle;
692 String dependencyResolution;
693 String dependencyCollection;
694 Boolean directInvocationOnly;
695 Boolean projectRequired;
696 Boolean onlineRequired;
697 Boolean aggregator;
698 Boolean inheritedByDefault;
699 String since;
700 String deprecated;
701 String configurator;
702 Collection<Parameter> parameters;
703 String id;
704 String fullGoalName;
705
706 Builder(boolean withDefaults) {
707 if (withDefaults) {
708 this.language = "java";
709 this.dependencyResolution = "runtime";
710 this.directInvocationOnly = false;
711 this.projectRequired = true;
712 this.onlineRequired = false;
713 this.aggregator = false;
714 this.inheritedByDefault = true;
715 }
716 }
717
718 Builder(MojoDescriptor base, boolean forceCopy) {
719 if (forceCopy) {
720 this.goal = base.goal;
721 this.description = base.description;
722 this.implementation = base.implementation;
723 this.language = base.language;
724 this.phase = base.phase;
725 this.executePhase = base.executePhase;
726 this.executeGoal = base.executeGoal;
727 this.executeLifecycle = base.executeLifecycle;
728 this.dependencyResolution = base.dependencyResolution;
729 this.dependencyCollection = base.dependencyCollection;
730 this.directInvocationOnly = base.directInvocationOnly;
731 this.projectRequired = base.projectRequired;
732 this.onlineRequired = base.onlineRequired;
733 this.aggregator = base.aggregator;
734 this.inheritedByDefault = base.inheritedByDefault;
735 this.since = base.since;
736 this.deprecated = base.deprecated;
737 this.configurator = base.configurator;
738 this.parameters = base.parameters;
739 this.id = base.id;
740 this.fullGoalName = base.fullGoalName;
741 } else {
742 this.base = base;
743 }
744 }
745
746 @Nonnull
747 public Builder goal(String goal) {
748 this.goal = goal;
749 return this;
750 }
751
752 @Nonnull
753 public Builder description(String description) {
754 this.description = description;
755 return this;
756 }
757
758 @Nonnull
759 public Builder implementation(String implementation) {
760 this.implementation = implementation;
761 return this;
762 }
763
764 @Nonnull
765 public Builder language(String language) {
766 this.language = language;
767 return this;
768 }
769
770 @Nonnull
771 public Builder phase(String phase) {
772 this.phase = phase;
773 return this;
774 }
775
776 @Nonnull
777 public Builder executePhase(String executePhase) {
778 this.executePhase = executePhase;
779 return this;
780 }
781
782 @Nonnull
783 public Builder executeGoal(String executeGoal) {
784 this.executeGoal = executeGoal;
785 return this;
786 }
787
788 @Nonnull
789 public Builder executeLifecycle(String executeLifecycle) {
790 this.executeLifecycle = executeLifecycle;
791 return this;
792 }
793
794 @Nonnull
795 public Builder dependencyResolution(String dependencyResolution) {
796 this.dependencyResolution = dependencyResolution;
797 return this;
798 }
799
800 @Nonnull
801 public Builder dependencyCollection(String dependencyCollection) {
802 this.dependencyCollection = dependencyCollection;
803 return this;
804 }
805
806 @Nonnull
807 public Builder directInvocationOnly(boolean directInvocationOnly) {
808 this.directInvocationOnly = directInvocationOnly;
809 return this;
810 }
811
812 @Nonnull
813 public Builder projectRequired(boolean projectRequired) {
814 this.projectRequired = projectRequired;
815 return this;
816 }
817
818 @Nonnull
819 public Builder onlineRequired(boolean onlineRequired) {
820 this.onlineRequired = onlineRequired;
821 return this;
822 }
823
824 @Nonnull
825 public Builder aggregator(boolean aggregator) {
826 this.aggregator = aggregator;
827 return this;
828 }
829
830 @Nonnull
831 public Builder inheritedByDefault(boolean inheritedByDefault) {
832 this.inheritedByDefault = inheritedByDefault;
833 return this;
834 }
835
836 @Nonnull
837 public Builder since(String since) {
838 this.since = since;
839 return this;
840 }
841
842 @Nonnull
843 public Builder deprecated(String deprecated) {
844 this.deprecated = deprecated;
845 return this;
846 }
847
848 @Nonnull
849 public Builder configurator(String configurator) {
850 this.configurator = configurator;
851 return this;
852 }
853
854 @Nonnull
855 public Builder parameters(Collection<Parameter> parameters) {
856 this.parameters = parameters;
857 return this;
858 }
859
860 @Nonnull
861 public Builder id(String id) {
862 this.id = id;
863 return this;
864 }
865
866 @Nonnull
867 public Builder fullGoalName(String fullGoalName) {
868 this.fullGoalName = fullGoalName;
869 return this;
870 }
871
872
873 @Nonnull
874 public MojoDescriptor build() {
875 if (base != null
876 && (goal == null || goal == base.goal)
877 && (description == null || description == base.description)
878 && (implementation == null || implementation == base.implementation)
879 && (language == null || language == base.language)
880 && (phase == null || phase == base.phase)
881 && (executePhase == null || executePhase == base.executePhase)
882 && (executeGoal == null || executeGoal == base.executeGoal)
883 && (executeLifecycle == null || executeLifecycle == base.executeLifecycle)
884 && (dependencyResolution == null || dependencyResolution == base.dependencyResolution)
885 && (dependencyCollection == null || dependencyCollection == base.dependencyCollection)
886 && (directInvocationOnly == null || directInvocationOnly == base.directInvocationOnly)
887 && (projectRequired == null || projectRequired == base.projectRequired)
888 && (onlineRequired == null || onlineRequired == base.onlineRequired)
889 && (aggregator == null || aggregator == base.aggregator)
890 && (inheritedByDefault == null || inheritedByDefault == base.inheritedByDefault)
891 && (since == null || since == base.since)
892 && (deprecated == null || deprecated == base.deprecated)
893 && (configurator == null || configurator == base.configurator)
894 && (parameters == null || parameters == base.parameters)
895 && (id == null || id == base.id)
896 && (fullGoalName == null || fullGoalName == base.fullGoalName)
897 ) {
898 return base;
899 }
900 return new MojoDescriptor(
901 goal != null ? goal : (base != null ? base.goal : null),
902 description != null ? description : (base != null ? base.description : null),
903 implementation != null ? implementation : (base != null ? base.implementation : null),
904 language != null ? language : (base != null ? base.language : null),
905 phase != null ? phase : (base != null ? base.phase : null),
906 executePhase != null ? executePhase : (base != null ? base.executePhase : null),
907 executeGoal != null ? executeGoal : (base != null ? base.executeGoal : null),
908 executeLifecycle != null ? executeLifecycle : (base != null ? base.executeLifecycle : null),
909 dependencyResolution != null ? dependencyResolution : (base != null ? base.dependencyResolution : null),
910 dependencyCollection != null ? dependencyCollection : (base != null ? base.dependencyCollection : null),
911 directInvocationOnly != null ? directInvocationOnly : (base != null ? base.directInvocationOnly : false),
912 projectRequired != null ? projectRequired : (base != null ? base.projectRequired : true),
913 onlineRequired != null ? onlineRequired : (base != null ? base.onlineRequired : false),
914 aggregator != null ? aggregator : (base != null ? base.aggregator : false),
915 inheritedByDefault != null ? inheritedByDefault : (base != null ? base.inheritedByDefault : true),
916 since != null ? since : (base != null ? base.since : null),
917 deprecated != null ? deprecated : (base != null ? base.deprecated : null),
918 configurator != null ? configurator : (base != null ? base.configurator : null),
919 parameters != null ? parameters : (base != null ? base.parameters : null),
920 id != null ? id : (base != null ? base.id : null),
921 fullGoalName != null ? fullGoalName : (base != null ? base.fullGoalName : null)
922 );
923 }
924 }
925
926 }