View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.maven.shared.release.config;
20  
21  import java.util.List;
22  import java.util.regex.Matcher;
23  import java.util.regex.Pattern;
24  
25  import org.apache.maven.model.Scm;
26  import org.apache.maven.shared.release.util.ReleaseUtil;
27  import org.slf4j.Logger;
28  import org.slf4j.LoggerFactory;
29  
30  /**
31   * <p>ReleaseDescriptorBuilder class.</p>
32   *
33   * @author Robert Scholte
34   * @since 3.0.0-M5
35   */
36  public class ReleaseDescriptorBuilder {
37      private static final Pattern PROPERTY_PATTERN = Pattern.compile("\\$\\{[^}]+}");
38  
39      private final Logger logger;
40  
41      /**
42       * Hides inner logic of the release descriptor
43       *
44       * @author Robert Scholte
45       */
46      public static final class BuilderReleaseDescriptor extends ModelloReleaseDescriptor implements ReleaseDescriptor {
47          private BuilderReleaseDescriptor() {}
48      }
49  
50      private final BuilderReleaseDescriptor releaseDescriptor;
51  
52      /**
53       * <p>Constructor for ReleaseDescriptorBuilder.</p>
54       */
55      public ReleaseDescriptorBuilder() {
56          this(LoggerFactory.getLogger(ReleaseDescriptorBuilder.class));
57      }
58  
59      /**
60       * Constructor for testing purpose.
61       */
62      ReleaseDescriptorBuilder(Logger logger) {
63          this.releaseDescriptor = new BuilderReleaseDescriptor();
64          this.releaseDescriptor.setLineSeparator(ReleaseUtil.LS);
65          this.logger = logger;
66      }
67  
68      /**
69       * <p>addCheckModificationExclude.</p>
70       *
71       * @param string a {@link java.lang.String} object
72       * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
73       */
74      public ReleaseDescriptorBuilder addCheckModificationExclude(String string) {
75          releaseDescriptor.addCheckModificationExclude(string);
76          return this;
77      }
78  
79      /**
80       * <p>setActivateProfiles.</p>
81       *
82       * @param profiles a {@link java.util.List} object
83       * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
84       */
85      public ReleaseDescriptorBuilder setActivateProfiles(List<String> profiles) {
86          releaseDescriptor.setActivateProfiles(profiles);
87          return this;
88      }
89  
90      /**
91       * <p>setAddSchema.</p>
92       *
93       * @param addSchema a boolean
94       * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
95       */
96      public ReleaseDescriptorBuilder setAddSchema(boolean addSchema) {
97          releaseDescriptor.setAddSchema(addSchema);
98          return this;
99      }
100 
101     /**
102      * <p>setAdditionalArguments.</p>
103      *
104      * @param additionalArguments a {@link java.lang.String} object
105      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
106      */
107     public ReleaseDescriptorBuilder setAdditionalArguments(String additionalArguments) {
108         if (additionalArguments != null) {
109             Matcher matcher = PROPERTY_PATTERN.matcher(additionalArguments);
110             StringBuffer buf = new StringBuffer();
111             while (matcher.find()) {
112                 matcher.appendReplacement(buf, "");
113                 logger.warn("arguments parameter contains unresolved property: '{}'", matcher.group());
114             }
115             matcher.appendTail(buf);
116 
117             releaseDescriptor.setAdditionalArguments(buf.toString());
118         } else {
119             releaseDescriptor.setAdditionalArguments(null);
120         }
121         return this;
122     }
123 
124     /**
125      * <p>setAllowTimestampedSnapshots.</p>
126      *
127      * @param allowTimestampedSnapshots a boolean
128      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
129      */
130     public ReleaseDescriptorBuilder setAllowTimestampedSnapshots(boolean allowTimestampedSnapshots) {
131         releaseDescriptor.setAllowTimestampedSnapshots(allowTimestampedSnapshots);
132         return this;
133     }
134 
135     /**
136      * <p>setAutoVersionSubmodules.</p>
137      *
138      * @param autoVersionSubmodules a boolean
139      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
140      */
141     public ReleaseDescriptorBuilder setAutoVersionSubmodules(boolean autoVersionSubmodules) {
142         releaseDescriptor.setAutoVersionSubmodules(autoVersionSubmodules);
143         return this;
144     }
145 
146     /**
147      * <p>setBranchCreation.</p>
148      *
149      * @param branchCreation a boolean
150      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
151      */
152     public ReleaseDescriptorBuilder setBranchCreation(boolean branchCreation) {
153         releaseDescriptor.setBranchCreation(branchCreation);
154         return this;
155     }
156 
157     /**
158      * <p>setCheckModificationExcludes.</p>
159      *
160      * @param checkModificationExcludes a {@link java.util.List} object
161      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
162      */
163     public ReleaseDescriptorBuilder setCheckModificationExcludes(List<String> checkModificationExcludes) {
164         releaseDescriptor.setCheckModificationExcludes(checkModificationExcludes);
165         return this;
166     }
167 
168     /**
169      * <p>setCheckoutDirectory.</p>
170      *
171      * @param checkoutDirectory a {@link java.lang.String} object
172      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
173      */
174     public ReleaseDescriptorBuilder setCheckoutDirectory(String checkoutDirectory) {
175         releaseDescriptor.setCheckoutDirectory(checkoutDirectory);
176         return this;
177     }
178 
179     /**
180      * <p>setCommitByProject.</p>
181      *
182      * @param commitByProject a boolean
183      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
184      */
185     public ReleaseDescriptorBuilder setCommitByProject(boolean commitByProject) {
186         releaseDescriptor.setCommitByProject(commitByProject);
187         return this;
188     }
189 
190     /**
191      * <p>setCompletedPhase.</p>
192      *
193      * @param completedPhase a {@link java.lang.String} object
194      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
195      */
196     public ReleaseDescriptorBuilder setCompletedPhase(String completedPhase) {
197         releaseDescriptor.setCompletedPhase(completedPhase);
198         return this;
199     }
200 
201     /**
202      * <p>setCompletionGoals.</p>
203      *
204      * @param completionGoals a {@link java.lang.String} object
205      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
206      */
207     public ReleaseDescriptorBuilder setCompletionGoals(String completionGoals) {
208         releaseDescriptor.setCompletionGoals(completionGoals);
209         return this;
210     }
211 
212     /**
213      * <p>setDefaultDevelopmentVersion.</p>
214      *
215      * @param defaultDevelopmentVersion a {@link java.lang.String} object
216      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
217      */
218     public ReleaseDescriptorBuilder setDefaultDevelopmentVersion(String defaultDevelopmentVersion) {
219         releaseDescriptor.setDefaultDevelopmentVersion(defaultDevelopmentVersion);
220         return this;
221     }
222 
223     /**
224      * <p>setDefaultReleaseVersion.</p>
225      *
226      * @param defaultReleaseVersion a {@link java.lang.String} object
227      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
228      */
229     public ReleaseDescriptorBuilder setDefaultReleaseVersion(String defaultReleaseVersion) {
230         releaseDescriptor.setDefaultReleaseVersion(defaultReleaseVersion);
231         return this;
232     }
233 
234     /**
235      * <p>setDescription.</p>
236      *
237      * @param description a {@link java.lang.String} object
238      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
239      */
240     public ReleaseDescriptorBuilder setDescription(String description) {
241         releaseDescriptor.setDescription(description);
242         return this;
243     }
244 
245     /**
246      * <p>setGenerateReleasePoms.</p>
247      *
248      * @param generateReleasePoms a boolean
249      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
250      */
251     public ReleaseDescriptorBuilder setGenerateReleasePoms(boolean generateReleasePoms) {
252         releaseDescriptor.setGenerateReleasePoms(generateReleasePoms);
253         return this;
254     }
255 
256     /**
257      * <p>setInteractive.</p>
258      *
259      * @param interactive a boolean
260      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
261      */
262     public ReleaseDescriptorBuilder setInteractive(boolean interactive) {
263         releaseDescriptor.setInteractive(interactive);
264         return this;
265     }
266 
267     /**
268      * <p>setLineSeparator.</p>
269      *
270      * @param ls a {@link java.lang.String} object
271      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
272      */
273     public ReleaseDescriptorBuilder setLineSeparator(String ls) {
274         releaseDescriptor.setLineSeparator(ls);
275         return this;
276     }
277 
278     /**
279      * <p>setLocalCheckout.</p>
280      *
281      * @param localCheckout a boolean
282      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
283      */
284     public ReleaseDescriptorBuilder setLocalCheckout(boolean localCheckout) {
285         releaseDescriptor.setLocalCheckout(localCheckout);
286         return this;
287     }
288 
289     /**
290      * <p>setModelEncoding.</p>
291      *
292      * @param modelEncoding a {@link java.lang.String} object
293      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
294      */
295     public ReleaseDescriptorBuilder setModelEncoding(String modelEncoding) {
296         releaseDescriptor.setModelEncoding(modelEncoding);
297         return this;
298     }
299 
300     /**
301      * <p>setName.</p>
302      *
303      * @param name a {@link java.lang.String} object
304      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
305      */
306     public ReleaseDescriptorBuilder setName(String name) {
307         releaseDescriptor.setName(name);
308         return this;
309     }
310 
311     /**
312      * <p>setPerformGoals.</p>
313      *
314      * @param performGoals a {@link java.lang.String} object
315      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
316      */
317     public ReleaseDescriptorBuilder setPerformGoals(String performGoals) {
318         releaseDescriptor.setPerformGoals(performGoals);
319         return this;
320     }
321 
322     /**
323      * <p>setPomFileName.</p>
324      *
325      * @param pomFileName a {@link java.lang.String} object
326      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
327      */
328     public ReleaseDescriptorBuilder setPomFileName(String pomFileName) {
329         releaseDescriptor.setPomFileName(pomFileName);
330         return this;
331     }
332 
333     /**
334      * <p>setPreparationGoals.</p>
335      *
336      * @param preparationGoals a {@link java.lang.String} object
337      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
338      */
339     public ReleaseDescriptorBuilder setPreparationGoals(String preparationGoals) {
340         releaseDescriptor.setPreparationGoals(preparationGoals);
341         return this;
342     }
343 
344     /**
345      * <p>setProjectNamingPolicyId.</p>
346      *
347      * @param projectNamingPolicyId a {@link java.lang.String} object
348      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
349      */
350     public ReleaseDescriptorBuilder setProjectNamingPolicyId(String projectNamingPolicyId) {
351         releaseDescriptor.setProjectNamingPolicyId(projectNamingPolicyId);
352         return this;
353     }
354 
355     /**
356      * <p>setProjectVersionPolicyId.</p>
357      *
358      * @param projectVersionPolicyId a {@link java.lang.String} object
359      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
360      */
361     public ReleaseDescriptorBuilder setProjectVersionPolicyId(String projectVersionPolicyId) {
362         releaseDescriptor.setProjectVersionPolicyId(projectVersionPolicyId);
363         return this;
364     }
365 
366     /**
367      * <p>setProjectVersionPolicyConfig.</p>
368      *
369      * @param setProjectVersionPolicyConfig a {@link java.lang.String} object
370      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
371      */
372     public ReleaseDescriptorBuilder setProjectVersionPolicyConfig(String setProjectVersionPolicyConfig) {
373         releaseDescriptor.setProjectVersionPolicyConfig(setProjectVersionPolicyConfig);
374         return this;
375     }
376 
377     /**
378      * <p>setPushChanges.</p>
379      *
380      * @param pushChanges a boolean
381      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
382      */
383     public ReleaseDescriptorBuilder setPushChanges(boolean pushChanges) {
384         releaseDescriptor.setPushChanges(pushChanges);
385         return this;
386     }
387 
388     /**
389      * <p>setWorkItem.</p>
390      *
391      * @param workItem a {@link java.lang.String} object
392      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
393      */
394     public ReleaseDescriptorBuilder setWorkItem(String workItem) {
395         releaseDescriptor.setWorkItem(workItem);
396         return this;
397     }
398 
399     /**
400      * <p>setReleaseStrategyId.</p>
401      *
402      * @param releaseStrategyId a {@link java.lang.String} object
403      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
404      */
405     public ReleaseDescriptorBuilder setReleaseStrategyId(String releaseStrategyId) {
406         releaseDescriptor.setReleaseStrategyId(releaseStrategyId);
407         return this;
408     }
409 
410     /**
411      * <p>setRemoteTagging.</p>
412      *
413      * @param remoteTagging a boolean
414      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
415      */
416     public ReleaseDescriptorBuilder setRemoteTagging(boolean remoteTagging) {
417         releaseDescriptor.setRemoteTagging(remoteTagging);
418         return this;
419     }
420 
421     /**
422      * <p>setScmBranchBase.</p>
423      *
424      * @param scmBranchBase a {@link java.lang.String} object
425      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
426      */
427     public ReleaseDescriptorBuilder setScmBranchBase(String scmBranchBase) {
428         releaseDescriptor.setScmBranchBase(scmBranchBase);
429         return this;
430     }
431 
432     /**
433      * <p>setScmCommentPrefix.</p>
434      *
435      * @param scmCommentPrefix a {@link java.lang.String} object
436      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
437      */
438     public ReleaseDescriptorBuilder setScmCommentPrefix(String scmCommentPrefix) {
439         releaseDescriptor.setScmCommentPrefix(scmCommentPrefix);
440         return this;
441     }
442 
443     /**
444      * <p>setScmShallowClone.</p>
445      *
446      * @param scmShallowClone a boolean
447      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
448      * @since 3.0.0-M6
449      */
450     public ReleaseDescriptorBuilder setScmShallowClone(boolean scmShallowClone) {
451         releaseDescriptor.setScmShallowClone(scmShallowClone);
452         return this;
453     }
454 
455     /**
456      * <p>setScmReleaseCommitComment.</p>
457      *
458      * @param scmReleaseCommitComment a {@link java.lang.String} object
459      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
460      * @since 3.0.0-M1
461      */
462     public ReleaseDescriptorBuilder setScmReleaseCommitComment(String scmReleaseCommitComment) {
463         releaseDescriptor.setScmReleaseCommitComment(scmReleaseCommitComment);
464         return this;
465     }
466 
467     /**
468      * <p>setScmDevelopmentCommitComment.</p>
469      *
470      * @param scmDevelopmentCommitComment a {@link java.lang.String} object
471      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
472      * @since 3.0.0-M1
473      */
474     public ReleaseDescriptorBuilder setScmDevelopmentCommitComment(String scmDevelopmentCommitComment) {
475         releaseDescriptor.setScmDevelopmentCommitComment(scmDevelopmentCommitComment);
476         return this;
477     }
478 
479     /**
480      * <p>setScmBranchCommitComment.</p>
481      *
482      * @param scmBranchCommitComment a {@link java.lang.String} object
483      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
484      * @since 3.0.0-M1
485      */
486     public ReleaseDescriptorBuilder setScmBranchCommitComment(String scmBranchCommitComment) {
487         releaseDescriptor.setScmBranchCommitComment(scmBranchCommitComment);
488         return this;
489     }
490 
491     /**
492      * <p>setScmRollbackCommitComment.</p>
493      *
494      * @param scmRollbackCommitComment a {@link java.lang.String} object
495      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
496      * @since 3.0.0-M1
497      */
498     public ReleaseDescriptorBuilder setScmRollbackCommitComment(String scmRollbackCommitComment) {
499         releaseDescriptor.setScmRollbackCommitComment(scmRollbackCommitComment);
500         return this;
501     }
502 
503     /**
504      * <p>setScmId.</p>
505      *
506      * @param scmId a {@link java.lang.String} object
507      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
508      */
509     public ReleaseDescriptorBuilder setScmId(String scmId) {
510         releaseDescriptor.setScmId(scmId);
511         return this;
512     }
513 
514     /**
515      * <p>setScmPassword.</p>
516      *
517      * @param scmPassword a {@link java.lang.String} object
518      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
519      */
520     public ReleaseDescriptorBuilder setScmPassword(String scmPassword) {
521         releaseDescriptor.setScmPassword(scmPassword);
522         return this;
523     }
524 
525     /**
526      * <p>setScmPrivateKey.</p>
527      *
528      * @param scmPrivateKey a {@link java.lang.String} object
529      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
530      */
531     public ReleaseDescriptorBuilder setScmPrivateKey(String scmPrivateKey) {
532         releaseDescriptor.setScmPrivateKey(scmPrivateKey);
533         return this;
534     }
535 
536     /**
537      * <p>setScmPrivateKeyPassPhrase.</p>
538      *
539      * @param scmPrivateKeyPassPhrase a {@link java.lang.String} object
540      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
541      */
542     public ReleaseDescriptorBuilder setScmPrivateKeyPassPhrase(String scmPrivateKeyPassPhrase) {
543         releaseDescriptor.setScmPrivateKeyPassPhrase(scmPrivateKeyPassPhrase);
544         return this;
545     }
546 
547     /**
548      * <p>setScmRelativePathProjectDirectory.</p>
549      *
550      * @param scmRelativePathProjectDirectory a {@link java.lang.String} object
551      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
552      */
553     public ReleaseDescriptorBuilder setScmRelativePathProjectDirectory(String scmRelativePathProjectDirectory) {
554         releaseDescriptor.setScmRelativePathProjectDirectory(scmRelativePathProjectDirectory);
555         return this;
556     }
557 
558     /**
559      * <p>setScmReleaseLabel.</p>
560      *
561      * @param scmReleaseLabel a {@link java.lang.String} object
562      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
563      */
564     public ReleaseDescriptorBuilder setScmReleaseLabel(String scmReleaseLabel) {
565         releaseDescriptor.setScmReleaseLabel(scmReleaseLabel);
566         return this;
567     }
568 
569     /**
570      * <p>setScmReleasedPomRevision.</p>
571      *
572      * @param scmReleasedPomRevision a {@link java.lang.String} object
573      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
574      */
575     public ReleaseDescriptorBuilder setScmReleasedPomRevision(String scmReleasedPomRevision) {
576         releaseDescriptor.setScmReleasedPomRevision(scmReleasedPomRevision);
577         return this;
578     }
579 
580     /**
581      * <p>setScmSourceUrl.</p>
582      *
583      * @param scmSourceUrl a {@link java.lang.String} object
584      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
585      */
586     public ReleaseDescriptorBuilder setScmSourceUrl(String scmSourceUrl) {
587         releaseDescriptor.setScmSourceUrl(scmSourceUrl);
588         return this;
589     }
590 
591     /**
592      * <p>setScmTagBase.</p>
593      *
594      * @param scmTagBase a {@link java.lang.String} object
595      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
596      */
597     public ReleaseDescriptorBuilder setScmTagBase(String scmTagBase) {
598         releaseDescriptor.setScmTagBase(scmTagBase);
599         return this;
600     }
601 
602     /**
603      * <p>setScmTagNameFormat.</p>
604      *
605      * @param scmTagNameFormat a {@link java.lang.String} object
606      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
607      */
608     public ReleaseDescriptorBuilder setScmTagNameFormat(String scmTagNameFormat) {
609         releaseDescriptor.setScmTagNameFormat(scmTagNameFormat);
610         return this;
611     }
612 
613     /**
614      * <p>setScmSignTags.</p>
615      *
616      * @param signTags a boolean
617      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
618      */
619     public ReleaseDescriptorBuilder setScmSignTags(boolean signTags) {
620         releaseDescriptor.setScmSignTags(signTags);
621         return this;
622     }
623 
624     /**
625      * <p>setScmUseEditMode.</p>
626      *
627      * @param scmUseEditMode a boolean
628      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
629      */
630     public ReleaseDescriptorBuilder setScmUseEditMode(boolean scmUseEditMode) {
631         releaseDescriptor.setScmUseEditMode(scmUseEditMode);
632         return this;
633     }
634 
635     /**
636      * <p>setScmUsername.</p>
637      *
638      * @param scmUsername a {@link java.lang.String} object
639      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
640      */
641     public ReleaseDescriptorBuilder setScmUsername(String scmUsername) {
642         releaseDescriptor.setScmUsername(scmUsername);
643         return this;
644     }
645 
646     /**
647      * <p>setSnapshotReleasePluginAllowed.</p>
648      *
649      * @param snapshotReleasePluginAllowed a boolean
650      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
651      */
652     public ReleaseDescriptorBuilder setSnapshotReleasePluginAllowed(boolean snapshotReleasePluginAllowed) {
653         releaseDescriptor.setSnapshotReleasePluginAllowed(snapshotReleasePluginAllowed);
654         return this;
655     }
656 
657     /**
658      * <p>setSuppressCommitBeforeTagOrBranch.</p>
659      *
660      * @param suppressCommitBeforeTagOrBranch a boolean
661      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
662      */
663     public ReleaseDescriptorBuilder setSuppressCommitBeforeTagOrBranch(boolean suppressCommitBeforeTagOrBranch) {
664         releaseDescriptor.setSuppressCommitBeforeTagOrBranch(suppressCommitBeforeTagOrBranch);
665         return this;
666     }
667 
668     /**
669      * <p>setUpdateBranchVersions.</p>
670      *
671      * @param updateBranchVersions a boolean
672      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
673      */
674     public ReleaseDescriptorBuilder setUpdateBranchVersions(boolean updateBranchVersions) {
675         releaseDescriptor.setUpdateBranchVersions(updateBranchVersions);
676         return this;
677     }
678 
679     /**
680      * <p>setUpdateDependencies.</p>
681      *
682      * @param updateDependencies a boolean
683      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
684      */
685     public ReleaseDescriptorBuilder setUpdateDependencies(boolean updateDependencies) {
686         releaseDescriptor.setUpdateDependencies(updateDependencies);
687         return this;
688     }
689 
690     /**
691      * <p>setUpdateVersionsToSnapshot.</p>
692      *
693      * @param updateVersionsToSnapshot a boolean
694      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
695      */
696     public ReleaseDescriptorBuilder setUpdateVersionsToSnapshot(boolean updateVersionsToSnapshot) {
697         releaseDescriptor.setUpdateVersionsToSnapshot(updateVersionsToSnapshot);
698         return this;
699     }
700 
701     /**
702      * <p>setUpdateWorkingCopyVersions.</p>
703      *
704      * @param updateWorkingCopyVersions a boolean
705      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
706      */
707     public ReleaseDescriptorBuilder setUpdateWorkingCopyVersions(boolean updateWorkingCopyVersions) {
708         releaseDescriptor.setUpdateWorkingCopyVersions(updateWorkingCopyVersions);
709         return this;
710     }
711 
712     /**
713      * <p>setUseReleaseProfile.</p>
714      *
715      * @param useReleaseProfile a boolean
716      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
717      */
718     public ReleaseDescriptorBuilder setUseReleaseProfile(boolean useReleaseProfile) {
719         releaseDescriptor.setUseReleaseProfile(useReleaseProfile);
720         return this;
721     }
722 
723     /**
724      * <p>setWaitBeforeTagging.</p>
725      *
726      * @param waitBeforeTagging a int
727      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
728      */
729     public ReleaseDescriptorBuilder setWaitBeforeTagging(int waitBeforeTagging) {
730         releaseDescriptor.setWaitBeforeTagging(waitBeforeTagging);
731         return this;
732     }
733 
734     /**
735      * <p>setWorkingDirectory.</p>
736      *
737      * @param workingDirectory a {@link java.lang.String} object
738      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
739      */
740     public ReleaseDescriptorBuilder setWorkingDirectory(String workingDirectory) {
741         releaseDescriptor.setWorkingDirectory(workingDirectory);
742         return this;
743     }
744 
745     /**
746      * <p>addReleaseVersion.</p>
747      *
748      * @param key   a {@link java.lang.String} object
749      * @param value a {@link java.lang.String} object
750      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
751      */
752     public ReleaseDescriptorBuilder addReleaseVersion(String key, String value) {
753         releaseDescriptor.addReleaseVersion(key, value);
754         return this;
755     }
756 
757     /**
758      * <p>addDevelopmentVersion.</p>
759      *
760      * @param key   a {@link java.lang.String} object
761      * @param value a {@link java.lang.String} object
762      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
763      */
764     public ReleaseDescriptorBuilder addDevelopmentVersion(String key, String value) {
765         releaseDescriptor.addDevelopmentVersion(key, value);
766         return this;
767     }
768 
769     /**
770      * <p>addOriginalScmInfo.</p>
771      *
772      * @param key   a {@link java.lang.String} object
773      * @param value a {@link org.apache.maven.model.Scm} object
774      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
775      */
776     public ReleaseDescriptorBuilder addOriginalScmInfo(String key, Scm value) {
777         releaseDescriptor.addOriginalScmInfo(key, value);
778         return this;
779     }
780 
781     /**
782      * <p>putOriginalVersion.</p>
783      *
784      * @param projectKey a {@link java.lang.String} object
785      * @param version    a {@link java.lang.String} object
786      */
787     public void putOriginalVersion(String projectKey, String version) {
788         releaseDescriptor.addOriginalVersion(projectKey, version);
789     }
790 
791     /**
792      * <p>addDependencyOriginalVersion.</p>
793      *
794      * @param dependencyKey a {@link java.lang.String} object
795      * @param version       a {@link java.lang.String} object
796      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
797      */
798     public ReleaseDescriptorBuilder addDependencyOriginalVersion(String dependencyKey, String version) {
799         releaseDescriptor.addDependencyOriginalVersion(dependencyKey, version);
800         return this;
801     }
802 
803     /**
804      * <p>addDependencyReleaseVersion.</p>
805      *
806      * @param dependencyKey a {@link java.lang.String} object
807      * @param version       a {@link java.lang.String} object
808      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
809      */
810     public ReleaseDescriptorBuilder addDependencyReleaseVersion(String dependencyKey, String version) {
811         releaseDescriptor.addDependencyReleaseVersion(dependencyKey, version);
812         return this;
813     }
814 
815     /**
816      * <p>addDependencyDevelopmentVersion.</p>
817      *
818      * @param dependencyKey a {@link java.lang.String} object
819      * @param version       a {@link java.lang.String} object
820      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
821      */
822     public ReleaseDescriptorBuilder addDependencyDevelopmentVersion(String dependencyKey, String version) {
823         releaseDescriptor.addDependencyDevelopmentVersion(dependencyKey, version);
824         return this;
825     }
826 
827     /**
828      * <p>setAutoResolveSnapshots.</p>
829      *
830      * @param autoResolveSnapshots a {@link java.lang.String} object
831      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
832      */
833     public ReleaseDescriptorBuilder setAutoResolveSnapshots(String autoResolveSnapshots) {
834         releaseDescriptor.setAutoResolveSnapshots(autoResolveSnapshots);
835         return this;
836     }
837 
838     /**
839      * <p>setPinExternals.</p>
840      *
841      * @param pinExternals a boolean
842      * @return a {@link org.apache.maven.shared.release.config.ReleaseDescriptorBuilder} object
843      */
844     public ReleaseDescriptorBuilder setPinExternals(boolean pinExternals) {
845         releaseDescriptor.setPinExternals(pinExternals);
846         return this;
847     }
848 
849     public BuilderReleaseDescriptor build() {
850         return releaseDescriptor;
851     }
852 }