View Javadoc
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.model;
6   
7   import java.io.Serializable;
8   import java.nio.file.Path;
9   import java.util.ArrayList;
10  import java.util.Collection;
11  import java.util.Collections;
12  import java.util.HashMap;
13  import java.util.List;
14  import java.util.Map;
15  import org.apache.maven.api.annotations.Experimental;
16  import org.apache.maven.api.annotations.Generated;
17  import org.apache.maven.api.annotations.Immutable;
18  import org.apache.maven.api.annotations.Nonnull;
19  import org.apache.maven.api.annotations.NotThreadSafe;
20  import org.apache.maven.api.annotations.ThreadSafe;
21  
22  /**
23   * The {@code <project>} element is the root of the descriptor.
24   * The following table lists all of the possible child elements.
25   */
26  @Experimental
27  @Generated @ThreadSafe @Immutable
28  public class Model
29      extends ModelBase
30      implements Serializable, InputLocationTracker
31  {
32      final String modelEncoding;
33      /**
34       * Originating POM file
35       */
36      final Path pomFile;
37      /**
38       * Declares to which version of project descriptor this POM conforms.
39       */
40      final String modelVersion;
41      /**
42       * The location of the parent project, if one exists. Values from the parent
43       * project will be the default for this project if they are left unspecified. The location
44       * is given as a group ID, artifact ID and version.
45       */
46      final Parent parent;
47      /**
48       * A universally unique identifier for a project. It is normal to
49       * use a fully-qualified package name to distinguish it from other
50       * projects with a similar name (eg. {@code org.apache.maven}).
51       */
52      final String groupId;
53      /**
54       * The identifier for this artifact that is unique within the group given by the
55       * group ID. An artifact is something that is either produced or used by a project.
56       * Examples of artifacts produced by Maven for a project include: JARs, source and binary
57       * distributions, and WARs.
58       */
59      final String artifactId;
60      /**
61       * The current version of the artifact produced by this project.
62       */
63      final String version;
64      /**
65       * The type of artifact this project produces, for example {@code jar}
66       * {@code war}
67       * {@code ear}
68       * {@code pom}.
69       * Plugins can create their own packaging, and
70       * therefore their own packaging types,
71       * so this list does not contain all possible types.
72       */
73      final String packaging;
74      /**
75       * The full name of the project.
76       */
77      final String name;
78      /**
79       * A detailed description of the project, used by Maven whenever it needs to
80       * describe the project, such as on the web site. While this element can be specified as
81       * CDATA to enable the use of HTML tags within the description, it is discouraged to allow
82       * plain text representation. If you need to modify the index page of the generated web
83       * site, you are able to specify your own instead of adjusting this text.
84       */
85      final String description;
86      /**
87       * The URL to the project's homepage.
88       * <br><b>Default value is</b>: parent value [+ path adjustment] + (artifactId or project.directory property), or just parent value if
89       * project's {@code child.project.url.inherit.append.path="false"}
90       */
91      final String url;
92      /**
93       * When children inherit from project's url, append path or not? Note: While the type
94       * of this field is {@code String} for technical reasons, the semantic type is actually
95       * {@code Boolean}
96       * <br><b>Default value is</b>: {@code true}
97       * <br><b>Since</b>: Maven 3.6.1
98       */
99      final String childProjectUrlInheritAppendPath;
100     /**
101      * The year of the project's inception, specified with 4 digits. This value is
102      * used when generating copyright notices as well as being informational.
103      */
104     final String inceptionYear;
105     /**
106      * This element describes various attributes of the organization to which the
107      * project belongs. These attributes are utilized when documentation is created (for
108      * copyright notices and links).
109      */
110     final Organization organization;
111     /**
112      * This element describes all of the licenses for this project.
113      * Each license is described by a {@code license} element, which
114      * is then described by additional elements.
115      * Projects should only list the license(s) that applies to the project
116      * and not the licenses that apply to dependencies.
117      * If multiple licenses are listed, it is assumed that the user can select
118      * any of them, not that they must accept all.
119      */
120     final List<License> licenses;
121     /**
122      * Describes the committers of a project.
123      */
124     final List<Developer> developers;
125     /**
126      * Describes the contributors to a project that are not yet committers.
127      */
128     final List<Contributor> contributors;
129     /**
130      * Contains information about a project's mailing lists.
131      */
132     final List<MailingList> mailingLists;
133     /**
134      * Describes the prerequisites in the build environment for this project.
135      */
136     final Prerequisites prerequisites;
137     /**
138      * Specification for the SCM used by the project, such as CVS, Subversion, etc.
139      */
140     final Scm scm;
141     /**
142      * The project's issue management system information.
143      */
144     final IssueManagement issueManagement;
145     /**
146      * The project's continuous integration information.
147      */
148     final CiManagement ciManagement;
149     /**
150      * Information required to build the project.
151      */
152     final Build build;
153     /**
154      * A listing of project-local build profiles which will modify the build process
155      * when activated.
156      */
157     final List<Profile> profiles;
158     /** Location of the xml element for the field pomFile. */
159     final InputLocation pomFileLocation;
160     /** Location of the xml element for the field modelVersion. */
161     final InputLocation modelVersionLocation;
162     /** Location of the xml element for the field parent. */
163     final InputLocation parentLocation;
164     /** Location of the xml element for the field groupId. */
165     final InputLocation groupIdLocation;
166     /** Location of the xml element for the field artifactId. */
167     final InputLocation artifactIdLocation;
168     /** Location of the xml element for the field version. */
169     final InputLocation versionLocation;
170     /** Location of the xml element for the field packaging. */
171     final InputLocation packagingLocation;
172     /** Location of the xml element for the field name. */
173     final InputLocation nameLocation;
174     /** Location of the xml element for the field description. */
175     final InputLocation descriptionLocation;
176     /** Location of the xml element for the field url. */
177     final InputLocation urlLocation;
178     /** Location of the xml element for the field childProjectUrlInheritAppendPath. */
179     final InputLocation childProjectUrlInheritAppendPathLocation;
180     /** Location of the xml element for the field inceptionYear. */
181     final InputLocation inceptionYearLocation;
182     /** Location of the xml element for the field organization. */
183     final InputLocation organizationLocation;
184     /** Location of the xml element for the field licenses. */
185     final InputLocation licensesLocation;
186     /** Location of the xml element for the field developers. */
187     final InputLocation developersLocation;
188     /** Location of the xml element for the field contributors. */
189     final InputLocation contributorsLocation;
190     /** Location of the xml element for the field mailingLists. */
191     final InputLocation mailingListsLocation;
192     /** Location of the xml element for the field prerequisites. */
193     final InputLocation prerequisitesLocation;
194     /** Location of the xml element for the field scm. */
195     final InputLocation scmLocation;
196     /** Location of the xml element for the field issueManagement. */
197     final InputLocation issueManagementLocation;
198     /** Location of the xml element for the field ciManagement. */
199     final InputLocation ciManagementLocation;
200     /** Location of the xml element for the field build. */
201     final InputLocation buildLocation;
202     /** Location of the xml element for the field profiles. */
203     final InputLocation profilesLocation;
204 
205     /**
206       * Constructor for this class, package protected.
207       * @see Builder#build()
208       */
209     Model(
210         String modelEncoding,
211         Collection<String> modules,
212         DistributionManagement distributionManagement,
213         Map<String, String> properties,
214         DependencyManagement dependencyManagement,
215         Collection<Dependency> dependencies,
216         Collection<Repository> repositories,
217         Collection<Repository> pluginRepositories,
218         Reporting reporting,
219         Path pomFile,
220         String modelVersion,
221         Parent parent,
222         String groupId,
223         String artifactId,
224         String version,
225         String packaging,
226         String name,
227         String description,
228         String url,
229         String childProjectUrlInheritAppendPath,
230         String inceptionYear,
231         Organization organization,
232         Collection<License> licenses,
233         Collection<Developer> developers,
234         Collection<Contributor> contributors,
235         Collection<MailingList> mailingLists,
236         Prerequisites prerequisites,
237         Scm scm,
238         IssueManagement issueManagement,
239         CiManagement ciManagement,
240         Build build,
241         Collection<Profile> profiles,
242         Map<Object, InputLocation> locations,
243         InputLocation location,
244         InputLocation modulesLocation,
245         InputLocation distributionManagementLocation,
246         InputLocation propertiesLocation,
247         InputLocation dependencyManagementLocation,
248         InputLocation dependenciesLocation,
249         InputLocation repositoriesLocation,
250         InputLocation pluginRepositoriesLocation,
251         InputLocation reportingLocation,
252         InputLocation pomFileLocation,
253         InputLocation modelVersionLocation,
254         InputLocation parentLocation,
255         InputLocation groupIdLocation,
256         InputLocation artifactIdLocation,
257         InputLocation versionLocation,
258         InputLocation packagingLocation,
259         InputLocation nameLocation,
260         InputLocation descriptionLocation,
261         InputLocation urlLocation,
262         InputLocation childProjectUrlInheritAppendPathLocation,
263         InputLocation inceptionYearLocation,
264         InputLocation organizationLocation,
265         InputLocation licensesLocation,
266         InputLocation developersLocation,
267         InputLocation contributorsLocation,
268         InputLocation mailingListsLocation,
269         InputLocation prerequisitesLocation,
270         InputLocation scmLocation,
271         InputLocation issueManagementLocation,
272         InputLocation ciManagementLocation,
273         InputLocation buildLocation,
274         InputLocation profilesLocation
275     )
276     {
277         super(
278             modules,
279             distributionManagement,
280             properties,
281             dependencyManagement,
282             dependencies,
283             repositories,
284             pluginRepositories,
285             reporting,
286             locations,
287             location,
288             modulesLocation,
289             distributionManagementLocation,
290             propertiesLocation,
291             dependencyManagementLocation,
292             dependenciesLocation,
293             repositoriesLocation,
294             pluginRepositoriesLocation,
295             reportingLocation
296         );
297         this.modelEncoding = modelEncoding;
298         this.pomFile = pomFile;
299         this.modelVersion = modelVersion;
300         this.parent = parent;
301         this.groupId = groupId;
302         this.artifactId = artifactId;
303         this.version = version;
304         this.packaging = packaging;
305         this.name = name;
306         this.description = description;
307         this.url = url;
308         this.childProjectUrlInheritAppendPath = childProjectUrlInheritAppendPath;
309         this.inceptionYear = inceptionYear;
310         this.organization = organization;
311         this.licenses = ImmutableCollections.copy( licenses );
312         this.developers = ImmutableCollections.copy( developers );
313         this.contributors = ImmutableCollections.copy( contributors );
314         this.mailingLists = ImmutableCollections.copy( mailingLists );
315         this.prerequisites = prerequisites;
316         this.scm = scm;
317         this.issueManagement = issueManagement;
318         this.ciManagement = ciManagement;
319         this.build = build;
320         this.profiles = ImmutableCollections.copy( profiles );
321         this.pomFileLocation = pomFileLocation;
322         this.modelVersionLocation = modelVersionLocation;
323         this.parentLocation = parentLocation;
324         this.groupIdLocation = groupIdLocation;
325         this.artifactIdLocation = artifactIdLocation;
326         this.versionLocation = versionLocation;
327         this.packagingLocation = packagingLocation;
328         this.nameLocation = nameLocation;
329         this.descriptionLocation = descriptionLocation;
330         this.urlLocation = urlLocation;
331         this.childProjectUrlInheritAppendPathLocation = childProjectUrlInheritAppendPathLocation;
332         this.inceptionYearLocation = inceptionYearLocation;
333         this.organizationLocation = organizationLocation;
334         this.licensesLocation = licensesLocation;
335         this.developersLocation = developersLocation;
336         this.contributorsLocation = contributorsLocation;
337         this.mailingListsLocation = mailingListsLocation;
338         this.prerequisitesLocation = prerequisitesLocation;
339         this.scmLocation = scmLocation;
340         this.issueManagementLocation = issueManagementLocation;
341         this.ciManagementLocation = ciManagementLocation;
342         this.buildLocation = buildLocation;
343         this.profilesLocation = profilesLocation;
344     }
345 
346     public String getModelEncoding()
347     {
348         return modelEncoding;
349     }
350 
351     /**
352      * Originating POM file
353      *
354      * @return a {@code Path}
355      */
356     public Path getPomFile()
357     {
358         return this.pomFile;
359     }
360 
361     /**
362      * Declares to which version of project descriptor this POM conforms.
363      *
364      * @return a {@code String}
365      */
366     public String getModelVersion()
367     {
368         return this.modelVersion;
369     }
370 
371     /**
372      * The location of the parent project, if one exists. Values from the parent
373      * project will be the default for this project if they are left unspecified. The location
374      * is given as a group ID, artifact ID and version.
375      *
376      * @return a {@code Parent}
377      */
378     public Parent getParent()
379     {
380         return this.parent;
381     }
382 
383     /**
384      * A universally unique identifier for a project. It is normal to
385      * use a fully-qualified package name to distinguish it from other
386      * projects with a similar name (eg. {@code org.apache.maven}).
387      *
388      * @return a {@code String}
389      */
390     public String getGroupId()
391     {
392         return this.groupId;
393     }
394 
395     /**
396      * The identifier for this artifact that is unique within the group given by the
397      * group ID. An artifact is something that is either produced or used by a project.
398      * Examples of artifacts produced by Maven for a project include: JARs, source and binary
399      * distributions, and WARs.
400      *
401      * @return a {@code String}
402      */
403     public String getArtifactId()
404     {
405         return this.artifactId;
406     }
407 
408     /**
409      * The current version of the artifact produced by this project.
410      *
411      * @return a {@code String}
412      */
413     public String getVersion()
414     {
415         return this.version;
416     }
417 
418     /**
419      * The type of artifact this project produces, for example {@code jar}
420      * {@code war}
421      * {@code ear}
422      * {@code pom}.
423      * Plugins can create their own packaging, and
424      * therefore their own packaging types,
425      * so this list does not contain all possible types.
426      *
427      * @return a {@code String}
428      */
429     public String getPackaging()
430     {
431         return this.packaging;
432     }
433 
434     /**
435      * The full name of the project.
436      *
437      * @return a {@code String}
438      */
439     public String getName()
440     {
441         return this.name;
442     }
443 
444     /**
445      * A detailed description of the project, used by Maven whenever it needs to
446      * describe the project, such as on the web site. While this element can be specified as
447      * CDATA to enable the use of HTML tags within the description, it is discouraged to allow
448      * plain text representation. If you need to modify the index page of the generated web
449      * site, you are able to specify your own instead of adjusting this text.
450      *
451      * @return a {@code String}
452      */
453     public String getDescription()
454     {
455         return this.description;
456     }
457 
458     /**
459      * The URL to the project's homepage.
460      * <br><b>Default value is</b>: parent value [+ path adjustment] + (artifactId or project.directory property), or just parent value if
461      * project's {@code child.project.url.inherit.append.path="false"}
462      *
463      * @return a {@code String}
464      */
465     public String getUrl()
466     {
467         return this.url;
468     }
469 
470     /**
471      * When children inherit from project's url, append path or not? Note: While the type
472      * of this field is {@code String} for technical reasons, the semantic type is actually
473      * {@code Boolean}
474      * <br><b>Default value is</b>: {@code true}
475      * <br><b>Since</b>: Maven 3.6.1
476      *
477      * @return a {@code String}
478      */
479     public String getChildProjectUrlInheritAppendPath()
480     {
481         return this.childProjectUrlInheritAppendPath;
482     }
483 
484     /**
485      * The year of the project's inception, specified with 4 digits. This value is
486      * used when generating copyright notices as well as being informational.
487      *
488      * @return a {@code String}
489      */
490     public String getInceptionYear()
491     {
492         return this.inceptionYear;
493     }
494 
495     /**
496      * This element describes various attributes of the organization to which the
497      * project belongs. These attributes are utilized when documentation is created (for
498      * copyright notices and links).
499      *
500      * @return a {@code Organization}
501      */
502     public Organization getOrganization()
503     {
504         return this.organization;
505     }
506 
507     /**
508      * This element describes all of the licenses for this project.
509      * Each license is described by a {@code license} element, which
510      * is then described by additional elements.
511      * Projects should only list the license(s) that applies to the project
512      * and not the licenses that apply to dependencies.
513      * If multiple licenses are listed, it is assumed that the user can select
514      * any of them, not that they must accept all.
515      *
516      * @return a {@code List<License>}
517      */
518     @Nonnull
519     public List<License> getLicenses()
520     {
521         return this.licenses;
522     }
523 
524     /**
525      * Describes the committers of a project.
526      *
527      * @return a {@code List<Developer>}
528      */
529     @Nonnull
530     public List<Developer> getDevelopers()
531     {
532         return this.developers;
533     }
534 
535     /**
536      * Describes the contributors to a project that are not yet committers.
537      *
538      * @return a {@code List<Contributor>}
539      */
540     @Nonnull
541     public List<Contributor> getContributors()
542     {
543         return this.contributors;
544     }
545 
546     /**
547      * Contains information about a project's mailing lists.
548      *
549      * @return a {@code List<MailingList>}
550      */
551     @Nonnull
552     public List<MailingList> getMailingLists()
553     {
554         return this.mailingLists;
555     }
556 
557     /**
558      * Describes the prerequisites in the build environment for this project.
559      *
560      * @return a {@code Prerequisites}
561      */
562     public Prerequisites getPrerequisites()
563     {
564         return this.prerequisites;
565     }
566 
567     /**
568      * Specification for the SCM used by the project, such as CVS, Subversion, etc.
569      *
570      * @return a {@code Scm}
571      */
572     public Scm getScm()
573     {
574         return this.scm;
575     }
576 
577     /**
578      * The project's issue management system information.
579      *
580      * @return a {@code IssueManagement}
581      */
582     public IssueManagement getIssueManagement()
583     {
584         return this.issueManagement;
585     }
586 
587     /**
588      * The project's continuous integration information.
589      *
590      * @return a {@code CiManagement}
591      */
592     public CiManagement getCiManagement()
593     {
594         return this.ciManagement;
595     }
596 
597     /**
598      * Information required to build the project.
599      *
600      * @return a {@code Build}
601      */
602     public Build getBuild()
603     {
604         return this.build;
605     }
606 
607     /**
608      * A listing of project-local build profiles which will modify the build process
609      * when activated.
610      *
611      * @return a {@code List<Profile>}
612      */
613     @Nonnull
614     public List<Profile> getProfiles()
615     {
616         return this.profiles;
617     }
618 
619     /**
620      * Gets the location of the specified field in the input source.
621      */
622     public InputLocation getLocation( Object key )
623     {
624         if ( key instanceof String )
625         {
626             switch ( ( String ) key )
627             {
628                 case "pomFile":
629                     return pomFileLocation;
630                 case "modelVersion":
631                     return modelVersionLocation;
632                 case "parent":
633                     return parentLocation;
634                 case "groupId":
635                     return groupIdLocation;
636                 case "artifactId":
637                     return artifactIdLocation;
638                 case "version":
639                     return versionLocation;
640                 case "packaging":
641                     return packagingLocation;
642                 case "name":
643                     return nameLocation;
644                 case "description":
645                     return descriptionLocation;
646                 case "url":
647                     return urlLocation;
648                 case "childProjectUrlInheritAppendPath":
649                     return childProjectUrlInheritAppendPathLocation;
650                 case "inceptionYear":
651                     return inceptionYearLocation;
652                 case "organization":
653                     return organizationLocation;
654                 case "licenses":
655                     return licensesLocation;
656                 case "developers":
657                     return developersLocation;
658                 case "contributors":
659                     return contributorsLocation;
660                 case "mailingLists":
661                     return mailingListsLocation;
662                 case "prerequisites":
663                     return prerequisitesLocation;
664                 case "scm":
665                     return scmLocation;
666                 case "issueManagement":
667                     return issueManagementLocation;
668                 case "ciManagement":
669                     return ciManagementLocation;
670                 case "build":
671                     return buildLocation;
672                 case "profiles":
673                     return profilesLocation;
674             }
675         }
676         return super.getLocation( key );
677     }
678 
679     /**
680      * Creates a new builder with this object as the basis.
681      *
682      * @return a {@code Builder}
683      */
684     @Nonnull
685     public Builder with()
686     {
687         return newBuilder( this );
688     }
689     /**
690      * Creates a new {@code Model} instance using the specified modules.
691      *
692      * @param modules the new {@code Collection<String>} to use
693      * @return a {@code Model} with the specified modules
694      */
695     @Nonnull
696     public Model withModules( Collection<String> modules )
697     {
698         return with().modules( modules ).build();
699     }
700     /**
701      * Creates a new {@code Model} instance using the specified distributionManagement.
702      *
703      * @param distributionManagement the new {@code DistributionManagement} to use
704      * @return a {@code Model} with the specified distributionManagement
705      */
706     @Nonnull
707     public Model withDistributionManagement( DistributionManagement distributionManagement )
708     {
709         return with().distributionManagement( distributionManagement ).build();
710     }
711     /**
712      * Creates a new {@code Model} instance using the specified properties.
713      *
714      * @param properties the new {@code Map<String, String>} to use
715      * @return a {@code Model} with the specified properties
716      */
717     @Nonnull
718     public Model withProperties( Map<String, String> properties )
719     {
720         return with().properties( properties ).build();
721     }
722     /**
723      * Creates a new {@code Model} instance using the specified dependencyManagement.
724      *
725      * @param dependencyManagement the new {@code DependencyManagement} to use
726      * @return a {@code Model} with the specified dependencyManagement
727      */
728     @Nonnull
729     public Model withDependencyManagement( DependencyManagement dependencyManagement )
730     {
731         return with().dependencyManagement( dependencyManagement ).build();
732     }
733     /**
734      * Creates a new {@code Model} instance using the specified dependencies.
735      *
736      * @param dependencies the new {@code Collection<Dependency>} to use
737      * @return a {@code Model} with the specified dependencies
738      */
739     @Nonnull
740     public Model withDependencies( Collection<Dependency> dependencies )
741     {
742         return with().dependencies( dependencies ).build();
743     }
744     /**
745      * Creates a new {@code Model} instance using the specified repositories.
746      *
747      * @param repositories the new {@code Collection<Repository>} to use
748      * @return a {@code Model} with the specified repositories
749      */
750     @Nonnull
751     public Model withRepositories( Collection<Repository> repositories )
752     {
753         return with().repositories( repositories ).build();
754     }
755     /**
756      * Creates a new {@code Model} instance using the specified pluginRepositories.
757      *
758      * @param pluginRepositories the new {@code Collection<Repository>} to use
759      * @return a {@code Model} with the specified pluginRepositories
760      */
761     @Nonnull
762     public Model withPluginRepositories( Collection<Repository> pluginRepositories )
763     {
764         return with().pluginRepositories( pluginRepositories ).build();
765     }
766     /**
767      * Creates a new {@code Model} instance using the specified reporting.
768      *
769      * @param reporting the new {@code Reporting} to use
770      * @return a {@code Model} with the specified reporting
771      */
772     @Nonnull
773     public Model withReporting( Reporting reporting )
774     {
775         return with().reporting( reporting ).build();
776     }
777     /**
778      * Creates a new {@code Model} instance using the specified pomFile.
779      *
780      * @param pomFile the new {@code Path} to use
781      * @return a {@code Model} with the specified pomFile
782      */
783     @Nonnull
784     public Model withPomFile( Path pomFile )
785     {
786         return with().pomFile( pomFile ).build();
787     }
788     /**
789      * Creates a new {@code Model} instance using the specified modelVersion.
790      *
791      * @param modelVersion the new {@code String} to use
792      * @return a {@code Model} with the specified modelVersion
793      */
794     @Nonnull
795     public Model withModelVersion( String modelVersion )
796     {
797         return with().modelVersion( modelVersion ).build();
798     }
799     /**
800      * Creates a new {@code Model} instance using the specified parent.
801      *
802      * @param parent the new {@code Parent} to use
803      * @return a {@code Model} with the specified parent
804      */
805     @Nonnull
806     public Model withParent( Parent parent )
807     {
808         return with().parent( parent ).build();
809     }
810     /**
811      * Creates a new {@code Model} instance using the specified groupId.
812      *
813      * @param groupId the new {@code String} to use
814      * @return a {@code Model} with the specified groupId
815      */
816     @Nonnull
817     public Model withGroupId( String groupId )
818     {
819         return with().groupId( groupId ).build();
820     }
821     /**
822      * Creates a new {@code Model} instance using the specified artifactId.
823      *
824      * @param artifactId the new {@code String} to use
825      * @return a {@code Model} with the specified artifactId
826      */
827     @Nonnull
828     public Model withArtifactId( String artifactId )
829     {
830         return with().artifactId( artifactId ).build();
831     }
832     /**
833      * Creates a new {@code Model} instance using the specified version.
834      *
835      * @param version the new {@code String} to use
836      * @return a {@code Model} with the specified version
837      */
838     @Nonnull
839     public Model withVersion( String version )
840     {
841         return with().version( version ).build();
842     }
843     /**
844      * Creates a new {@code Model} instance using the specified packaging.
845      *
846      * @param packaging the new {@code String} to use
847      * @return a {@code Model} with the specified packaging
848      */
849     @Nonnull
850     public Model withPackaging( String packaging )
851     {
852         return with().packaging( packaging ).build();
853     }
854     /**
855      * Creates a new {@code Model} instance using the specified name.
856      *
857      * @param name the new {@code String} to use
858      * @return a {@code Model} with the specified name
859      */
860     @Nonnull
861     public Model withName( String name )
862     {
863         return with().name( name ).build();
864     }
865     /**
866      * Creates a new {@code Model} instance using the specified description.
867      *
868      * @param description the new {@code String} to use
869      * @return a {@code Model} with the specified description
870      */
871     @Nonnull
872     public Model withDescription( String description )
873     {
874         return with().description( description ).build();
875     }
876     /**
877      * Creates a new {@code Model} instance using the specified url.
878      *
879      * @param url the new {@code String} to use
880      * @return a {@code Model} with the specified url
881      */
882     @Nonnull
883     public Model withUrl( String url )
884     {
885         return with().url( url ).build();
886     }
887     /**
888      * Creates a new {@code Model} instance using the specified childProjectUrlInheritAppendPath.
889      *
890      * @param childProjectUrlInheritAppendPath the new {@code String} to use
891      * @return a {@code Model} with the specified childProjectUrlInheritAppendPath
892      */
893     @Nonnull
894     public Model withChildProjectUrlInheritAppendPath( String childProjectUrlInheritAppendPath )
895     {
896         return with().childProjectUrlInheritAppendPath( childProjectUrlInheritAppendPath ).build();
897     }
898     /**
899      * Creates a new {@code Model} instance using the specified inceptionYear.
900      *
901      * @param inceptionYear the new {@code String} to use
902      * @return a {@code Model} with the specified inceptionYear
903      */
904     @Nonnull
905     public Model withInceptionYear( String inceptionYear )
906     {
907         return with().inceptionYear( inceptionYear ).build();
908     }
909     /**
910      * Creates a new {@code Model} instance using the specified organization.
911      *
912      * @param organization the new {@code Organization} to use
913      * @return a {@code Model} with the specified organization
914      */
915     @Nonnull
916     public Model withOrganization( Organization organization )
917     {
918         return with().organization( organization ).build();
919     }
920     /**
921      * Creates a new {@code Model} instance using the specified licenses.
922      *
923      * @param licenses the new {@code Collection<License>} to use
924      * @return a {@code Model} with the specified licenses
925      */
926     @Nonnull
927     public Model withLicenses( Collection<License> licenses )
928     {
929         return with().licenses( licenses ).build();
930     }
931     /**
932      * Creates a new {@code Model} instance using the specified developers.
933      *
934      * @param developers the new {@code Collection<Developer>} to use
935      * @return a {@code Model} with the specified developers
936      */
937     @Nonnull
938     public Model withDevelopers( Collection<Developer> developers )
939     {
940         return with().developers( developers ).build();
941     }
942     /**
943      * Creates a new {@code Model} instance using the specified contributors.
944      *
945      * @param contributors the new {@code Collection<Contributor>} to use
946      * @return a {@code Model} with the specified contributors
947      */
948     @Nonnull
949     public Model withContributors( Collection<Contributor> contributors )
950     {
951         return with().contributors( contributors ).build();
952     }
953     /**
954      * Creates a new {@code Model} instance using the specified mailingLists.
955      *
956      * @param mailingLists the new {@code Collection<MailingList>} to use
957      * @return a {@code Model} with the specified mailingLists
958      */
959     @Nonnull
960     public Model withMailingLists( Collection<MailingList> mailingLists )
961     {
962         return with().mailingLists( mailingLists ).build();
963     }
964     /**
965      * Creates a new {@code Model} instance using the specified prerequisites.
966      *
967      * @param prerequisites the new {@code Prerequisites} to use
968      * @return a {@code Model} with the specified prerequisites
969      */
970     @Nonnull
971     public Model withPrerequisites( Prerequisites prerequisites )
972     {
973         return with().prerequisites( prerequisites ).build();
974     }
975     /**
976      * Creates a new {@code Model} instance using the specified scm.
977      *
978      * @param scm the new {@code Scm} to use
979      * @return a {@code Model} with the specified scm
980      */
981     @Nonnull
982     public Model withScm( Scm scm )
983     {
984         return with().scm( scm ).build();
985     }
986     /**
987      * Creates a new {@code Model} instance using the specified issueManagement.
988      *
989      * @param issueManagement the new {@code IssueManagement} to use
990      * @return a {@code Model} with the specified issueManagement
991      */
992     @Nonnull
993     public Model withIssueManagement( IssueManagement issueManagement )
994     {
995         return with().issueManagement( issueManagement ).build();
996     }
997     /**
998      * Creates a new {@code Model} instance using the specified ciManagement.
999      *
1000      * @param ciManagement the new {@code CiManagement} to use
1001      * @return a {@code Model} with the specified ciManagement
1002      */
1003     @Nonnull
1004     public Model withCiManagement( CiManagement ciManagement )
1005     {
1006         return with().ciManagement( ciManagement ).build();
1007     }
1008     /**
1009      * Creates a new {@code Model} instance using the specified build.
1010      *
1011      * @param build the new {@code Build} to use
1012      * @return a {@code Model} with the specified build
1013      */
1014     @Nonnull
1015     public Model withBuild( Build build )
1016     {
1017         return with().build( build ).build();
1018     }
1019     /**
1020      * Creates a new {@code Model} instance using the specified profiles.
1021      *
1022      * @param profiles the new {@code Collection<Profile>} to use
1023      * @return a {@code Model} with the specified profiles
1024      */
1025     @Nonnull
1026     public Model withProfiles( Collection<Profile> profiles )
1027     {
1028         return with().profiles( profiles ).build();
1029     }
1030 
1031     /**
1032      * Creates a new {@code Model} instance.
1033      * Equivalent to {@code newInstance( true )}.
1034      * @see #newInstance(boolean)
1035      *
1036      * @return a new {@code Model}
1037      */
1038     @Nonnull
1039     public static Model newInstance()
1040     {
1041         return newInstance( true );
1042     }
1043 
1044     /**
1045      * Creates a new {@code Model} instance using default values or not.
1046      * Equivalent to {@code newBuilder( withDefaults ).build()}.
1047      *
1048      * @param withDefaults the boolean indicating whether default values should be used
1049      * @return a new {@code Model}
1050      */
1051     @Nonnull
1052     public static Model newInstance( boolean withDefaults )
1053     {
1054         return newBuilder( withDefaults ).build();
1055     }
1056 
1057     /**
1058      * Creates a new {@code Model} builder instance.
1059      * Equivalent to {@code newBuilder( true )}.
1060      * @see #newBuilder(boolean)
1061      *
1062      * @return a new {@code Builder}
1063      */
1064     @Nonnull
1065     public static Builder newBuilder()
1066     {
1067         return newBuilder( true );
1068     }
1069 
1070     /**
1071      * Creates a new {@code Model} builder instance using default values or not.
1072      *
1073      * @param withDefaults the boolean indicating whether default values should be used
1074      * @return a new {@code Builder}
1075      */
1076     @Nonnull
1077     public static Builder newBuilder( boolean withDefaults )
1078     {
1079         return new Builder( withDefaults );
1080     }
1081 
1082     /**
1083      * Creates a new {@code Model} builder instance using the specified object as a basis.
1084      * Equivalent to {@code newBuilder( from, false )}.
1085      *
1086      * @param from the {@code Model} instance to use as a basis
1087      * @return a new {@code Builder}
1088      */
1089     @Nonnull
1090     public static Builder newBuilder( Model from )
1091     {
1092         return newBuilder( from, false );
1093     }
1094 
1095     /**
1096      * Creates a new {@code Model} builder instance using the specified object as a basis.
1097      *
1098      * @param from the {@code Model} instance to use as a basis
1099      * @param forceCopy the boolean indicating if a copy should be forced
1100      * @return a new {@code Builder}
1101      */
1102     @Nonnull
1103     public static Builder newBuilder( Model from, boolean forceCopy )
1104     {
1105         return new Builder( from, forceCopy );
1106     }
1107 
1108     /**
1109      * Builder class used to create Model instances.
1110      * @see #with()
1111      * @see #newBuilder()
1112      */
1113     @NotThreadSafe
1114     public static class Builder
1115         extends ModelBase.Builder
1116     {
1117         Model base;
1118         String modelEncoding;
1119         Path pomFile;
1120         String modelVersion;
1121         Parent parent;
1122         String groupId;
1123         String artifactId;
1124         String version;
1125         String packaging;
1126         String name;
1127         String description;
1128         String url;
1129         String childProjectUrlInheritAppendPath;
1130         String inceptionYear;
1131         Organization organization;
1132         Collection<License> licenses;
1133         Collection<Developer> developers;
1134         Collection<Contributor> contributors;
1135         Collection<MailingList> mailingLists;
1136         Prerequisites prerequisites;
1137         Scm scm;
1138         IssueManagement issueManagement;
1139         CiManagement ciManagement;
1140         Build build;
1141         Collection<Profile> profiles;
1142 
1143         Builder( boolean withDefaults )
1144         {
1145             super( withDefaults );
1146             if ( withDefaults )
1147             {
1148                 this.packaging = "jar";
1149             }
1150         }
1151 
1152         Builder( Model base, boolean forceCopy )
1153         {
1154             super( base, forceCopy );
1155             if ( forceCopy )
1156             {
1157                 this.pomFile = base.pomFile;
1158                 this.modelVersion = base.modelVersion;
1159                 this.parent = base.parent;
1160                 this.groupId = base.groupId;
1161                 this.artifactId = base.artifactId;
1162                 this.version = base.version;
1163                 this.packaging = base.packaging;
1164                 this.name = base.name;
1165                 this.description = base.description;
1166                 this.url = base.url;
1167                 this.childProjectUrlInheritAppendPath = base.childProjectUrlInheritAppendPath;
1168                 this.inceptionYear = base.inceptionYear;
1169                 this.organization = base.organization;
1170                 this.licenses = base.licenses;
1171                 this.developers = base.developers;
1172                 this.contributors = base.contributors;
1173                 this.mailingLists = base.mailingLists;
1174                 this.prerequisites = base.prerequisites;
1175                 this.scm = base.scm;
1176                 this.issueManagement = base.issueManagement;
1177                 this.ciManagement = base.ciManagement;
1178                 this.build = base.build;
1179                 this.profiles = base.profiles;
1180             }
1181             else
1182             {
1183                 this.base = base;
1184             }
1185         }
1186 
1187         @Nonnull
1188         public Builder modelEncoding( String modelEncoding )
1189         {
1190             this.modelEncoding = modelEncoding;
1191             return this;
1192         }
1193 
1194         @Nonnull
1195         public Builder modules( Collection<String> modules )
1196         {
1197             this.modules = modules;
1198             return this;
1199         }
1200 
1201         @Nonnull
1202         public Builder distributionManagement( DistributionManagement distributionManagement )
1203         {
1204             this.distributionManagement = distributionManagement;
1205             return this;
1206         }
1207 
1208         @Nonnull
1209         public Builder properties( Map<String, String> properties )
1210         {
1211             this.properties = properties;
1212             return this;
1213         }
1214 
1215         @Nonnull
1216         public Builder dependencyManagement( DependencyManagement dependencyManagement )
1217         {
1218             this.dependencyManagement = dependencyManagement;
1219             return this;
1220         }
1221 
1222         @Nonnull
1223         public Builder dependencies( Collection<Dependency> dependencies )
1224         {
1225             this.dependencies = dependencies;
1226             return this;
1227         }
1228 
1229         @Nonnull
1230         public Builder repositories( Collection<Repository> repositories )
1231         {
1232             this.repositories = repositories;
1233             return this;
1234         }
1235 
1236         @Nonnull
1237         public Builder pluginRepositories( Collection<Repository> pluginRepositories )
1238         {
1239             this.pluginRepositories = pluginRepositories;
1240             return this;
1241         }
1242 
1243         @Nonnull
1244         public Builder reporting( Reporting reporting )
1245         {
1246             this.reporting = reporting;
1247             return this;
1248         }
1249 
1250         @Nonnull
1251         public Builder pomFile( Path pomFile )
1252         {
1253             this.pomFile = pomFile;
1254             return this;
1255         }
1256 
1257         @Nonnull
1258         public Builder modelVersion( String modelVersion )
1259         {
1260             this.modelVersion = modelVersion;
1261             return this;
1262         }
1263 
1264         @Nonnull
1265         public Builder parent( Parent parent )
1266         {
1267             this.parent = parent;
1268             return this;
1269         }
1270 
1271         @Nonnull
1272         public Builder groupId( String groupId )
1273         {
1274             this.groupId = groupId;
1275             return this;
1276         }
1277 
1278         @Nonnull
1279         public Builder artifactId( String artifactId )
1280         {
1281             this.artifactId = artifactId;
1282             return this;
1283         }
1284 
1285         @Nonnull
1286         public Builder version( String version )
1287         {
1288             this.version = version;
1289             return this;
1290         }
1291 
1292         @Nonnull
1293         public Builder packaging( String packaging )
1294         {
1295             this.packaging = packaging;
1296             return this;
1297         }
1298 
1299         @Nonnull
1300         public Builder name( String name )
1301         {
1302             this.name = name;
1303             return this;
1304         }
1305 
1306         @Nonnull
1307         public Builder description( String description )
1308         {
1309             this.description = description;
1310             return this;
1311         }
1312 
1313         @Nonnull
1314         public Builder url( String url )
1315         {
1316             this.url = url;
1317             return this;
1318         }
1319 
1320         @Nonnull
1321         public Builder childProjectUrlInheritAppendPath( String childProjectUrlInheritAppendPath )
1322         {
1323             this.childProjectUrlInheritAppendPath = childProjectUrlInheritAppendPath;
1324             return this;
1325         }
1326 
1327         @Nonnull
1328         public Builder inceptionYear( String inceptionYear )
1329         {
1330             this.inceptionYear = inceptionYear;
1331             return this;
1332         }
1333 
1334         @Nonnull
1335         public Builder organization( Organization organization )
1336         {
1337             this.organization = organization;
1338             return this;
1339         }
1340 
1341         @Nonnull
1342         public Builder licenses( Collection<License> licenses )
1343         {
1344             this.licenses = licenses;
1345             return this;
1346         }
1347 
1348         @Nonnull
1349         public Builder developers( Collection<Developer> developers )
1350         {
1351             this.developers = developers;
1352             return this;
1353         }
1354 
1355         @Nonnull
1356         public Builder contributors( Collection<Contributor> contributors )
1357         {
1358             this.contributors = contributors;
1359             return this;
1360         }
1361 
1362         @Nonnull
1363         public Builder mailingLists( Collection<MailingList> mailingLists )
1364         {
1365             this.mailingLists = mailingLists;
1366             return this;
1367         }
1368 
1369         @Nonnull
1370         public Builder prerequisites( Prerequisites prerequisites )
1371         {
1372             this.prerequisites = prerequisites;
1373             return this;
1374         }
1375 
1376         @Nonnull
1377         public Builder scm( Scm scm )
1378         {
1379             this.scm = scm;
1380             return this;
1381         }
1382 
1383         @Nonnull
1384         public Builder issueManagement( IssueManagement issueManagement )
1385         {
1386             this.issueManagement = issueManagement;
1387             return this;
1388         }
1389 
1390         @Nonnull
1391         public Builder ciManagement( CiManagement ciManagement )
1392         {
1393             this.ciManagement = ciManagement;
1394             return this;
1395         }
1396 
1397         @Nonnull
1398         public Builder build( Build build )
1399         {
1400             this.build = build;
1401             return this;
1402         }
1403 
1404         @Nonnull
1405         public Builder profiles( Collection<Profile> profiles )
1406         {
1407             this.profiles = profiles;
1408             return this;
1409         }
1410 
1411 
1412         @Nonnull
1413         public Builder location( Object key, InputLocation location )
1414         {
1415             if ( location != null )
1416             {
1417                 if ( this.locations == null )
1418                 {
1419                     this.locations = new HashMap<>();
1420                 }
1421                 this.locations.put( key, location );
1422             }
1423             return this;
1424         }
1425 
1426         @Nonnull
1427         public Model build()
1428         {
1429             if ( base != null
1430                     && ( modules == null || modules == base.modules )
1431                     && ( distributionManagement == null || distributionManagement == base.distributionManagement )
1432                     && ( properties == null || properties == base.properties )
1433                     && ( dependencyManagement == null || dependencyManagement == base.dependencyManagement )
1434                     && ( dependencies == null || dependencies == base.dependencies )
1435                     && ( repositories == null || repositories == base.repositories )
1436                     && ( pluginRepositories == null || pluginRepositories == base.pluginRepositories )
1437                     && ( reporting == null || reporting == base.reporting )
1438                     && ( pomFile == null || pomFile == base.pomFile )
1439                     && ( modelVersion == null || modelVersion == base.modelVersion )
1440                     && ( parent == null || parent == base.parent )
1441                     && ( groupId == null || groupId == base.groupId )
1442                     && ( artifactId == null || artifactId == base.artifactId )
1443                     && ( version == null || version == base.version )
1444                     && ( packaging == null || packaging == base.packaging )
1445                     && ( name == null || name == base.name )
1446                     && ( description == null || description == base.description )
1447                     && ( url == null || url == base.url )
1448                     && ( childProjectUrlInheritAppendPath == null || childProjectUrlInheritAppendPath == base.childProjectUrlInheritAppendPath )
1449                     && ( inceptionYear == null || inceptionYear == base.inceptionYear )
1450                     && ( organization == null || organization == base.organization )
1451                     && ( licenses == null || licenses == base.licenses )
1452                     && ( developers == null || developers == base.developers )
1453                     && ( contributors == null || contributors == base.contributors )
1454                     && ( mailingLists == null || mailingLists == base.mailingLists )
1455                     && ( prerequisites == null || prerequisites == base.prerequisites )
1456                     && ( scm == null || scm == base.scm )
1457                     && ( issueManagement == null || issueManagement == base.issueManagement )
1458                     && ( ciManagement == null || ciManagement == base.ciManagement )
1459                     && ( build == null || build == base.build )
1460                     && ( profiles == null || profiles == base.profiles )
1461             )
1462             {
1463                 return base;
1464             }
1465             Map<Object, InputLocation> locations = null;
1466             InputLocation location = null;
1467             InputLocation modulesLocation = null;
1468             InputLocation distributionManagementLocation = null;
1469             InputLocation propertiesLocation = null;
1470             InputLocation dependencyManagementLocation = null;
1471             InputLocation dependenciesLocation = null;
1472             InputLocation repositoriesLocation = null;
1473             InputLocation pluginRepositoriesLocation = null;
1474             InputLocation reportingLocation = null;
1475             InputLocation pomFileLocation = null;
1476             InputLocation modelVersionLocation = null;
1477             InputLocation parentLocation = null;
1478             InputLocation groupIdLocation = null;
1479             InputLocation artifactIdLocation = null;
1480             InputLocation versionLocation = null;
1481             InputLocation packagingLocation = null;
1482             InputLocation nameLocation = null;
1483             InputLocation descriptionLocation = null;
1484             InputLocation urlLocation = null;
1485             InputLocation childProjectUrlInheritAppendPathLocation = null;
1486             InputLocation inceptionYearLocation = null;
1487             InputLocation organizationLocation = null;
1488             InputLocation licensesLocation = null;
1489             InputLocation developersLocation = null;
1490             InputLocation contributorsLocation = null;
1491             InputLocation mailingListsLocation = null;
1492             InputLocation prerequisitesLocation = null;
1493             InputLocation scmLocation = null;
1494             InputLocation issueManagementLocation = null;
1495             InputLocation ciManagementLocation = null;
1496             InputLocation buildLocation = null;
1497             InputLocation profilesLocation = null;
1498             if ( this.locations != null )
1499             {
1500                 locations = this.locations;
1501                 location = locations.remove( "" );
1502                 modulesLocation = locations.remove( "modules" );
1503                 distributionManagementLocation = locations.remove( "distributionManagement" );
1504                 propertiesLocation = locations.remove( "properties" );
1505                 dependencyManagementLocation = locations.remove( "dependencyManagement" );
1506                 dependenciesLocation = locations.remove( "dependencies" );
1507                 repositoriesLocation = locations.remove( "repositories" );
1508                 pluginRepositoriesLocation = locations.remove( "pluginRepositories" );
1509                 reportingLocation = locations.remove( "reporting" );
1510                 pomFileLocation = locations.remove( "pomFile" );
1511                 modelVersionLocation = locations.remove( "modelVersion" );
1512                 parentLocation = locations.remove( "parent" );
1513                 groupIdLocation = locations.remove( "groupId" );
1514                 artifactIdLocation = locations.remove( "artifactId" );
1515                 versionLocation = locations.remove( "version" );
1516                 packagingLocation = locations.remove( "packaging" );
1517                 nameLocation = locations.remove( "name" );
1518                 descriptionLocation = locations.remove( "description" );
1519                 urlLocation = locations.remove( "url" );
1520                 childProjectUrlInheritAppendPathLocation = locations.remove( "childProjectUrlInheritAppendPath" );
1521                 inceptionYearLocation = locations.remove( "inceptionYear" );
1522                 organizationLocation = locations.remove( "organization" );
1523                 licensesLocation = locations.remove( "licenses" );
1524                 developersLocation = locations.remove( "developers" );
1525                 contributorsLocation = locations.remove( "contributors" );
1526                 mailingListsLocation = locations.remove( "mailingLists" );
1527                 prerequisitesLocation = locations.remove( "prerequisites" );
1528                 scmLocation = locations.remove( "scm" );
1529                 issueManagementLocation = locations.remove( "issueManagement" );
1530                 ciManagementLocation = locations.remove( "ciManagement" );
1531                 buildLocation = locations.remove( "build" );
1532                 profilesLocation = locations.remove( "profiles" );
1533             }
1534             return new Model(
1535                 modelEncoding != null ? modelEncoding : ( base != null ? base.modelEncoding : "UTF-8" ),
1536                 modules != null ? modules : ( base != null ? base.modules : null ),
1537                 distributionManagement != null ? distributionManagement : ( base != null ? base.distributionManagement : null ),
1538                 properties != null ? properties : ( base != null ? base.properties : null ),
1539                 dependencyManagement != null ? dependencyManagement : ( base != null ? base.dependencyManagement : null ),
1540                 dependencies != null ? dependencies : ( base != null ? base.dependencies : null ),
1541                 repositories != null ? repositories : ( base != null ? base.repositories : null ),
1542                 pluginRepositories != null ? pluginRepositories : ( base != null ? base.pluginRepositories : null ),
1543                 reporting != null ? reporting : ( base != null ? base.reporting : null ),
1544                 pomFile != null ? pomFile : ( base != null ? base.pomFile : null ),
1545                 modelVersion != null ? modelVersion : ( base != null ? base.modelVersion : null ),
1546                 parent != null ? parent : ( base != null ? base.parent : null ),
1547                 groupId != null ? groupId : ( base != null ? base.groupId : null ),
1548                 artifactId != null ? artifactId : ( base != null ? base.artifactId : null ),
1549                 version != null ? version : ( base != null ? base.version : null ),
1550                 packaging != null ? packaging : ( base != null ? base.packaging : null ),
1551                 name != null ? name : ( base != null ? base.name : null ),
1552                 description != null ? description : ( base != null ? base.description : null ),
1553                 url != null ? url : ( base != null ? base.url : null ),
1554                 childProjectUrlInheritAppendPath != null ? childProjectUrlInheritAppendPath : ( base != null ? base.childProjectUrlInheritAppendPath : null ),
1555                 inceptionYear != null ? inceptionYear : ( base != null ? base.inceptionYear : null ),
1556                 organization != null ? organization : ( base != null ? base.organization : null ),
1557                 licenses != null ? licenses : ( base != null ? base.licenses : null ),
1558                 developers != null ? developers : ( base != null ? base.developers : null ),
1559                 contributors != null ? contributors : ( base != null ? base.contributors : null ),
1560                 mailingLists != null ? mailingLists : ( base != null ? base.mailingLists : null ),
1561                 prerequisites != null ? prerequisites : ( base != null ? base.prerequisites : null ),
1562                 scm != null ? scm : ( base != null ? base.scm : null ),
1563                 issueManagement != null ? issueManagement : ( base != null ? base.issueManagement : null ),
1564                 ciManagement != null ? ciManagement : ( base != null ? base.ciManagement : null ),
1565                 build != null ? build : ( base != null ? base.build : null ),
1566                 profiles != null ? profiles : ( base != null ? base.profiles : null ),
1567                 locations != null ? locations : ( base != null ? base.locations : null ),
1568                 location != null ? location : ( base != null ? base.location : null ),
1569                 modulesLocation != null ? modulesLocation : ( base != null ? base.modulesLocation : null ),
1570                 distributionManagementLocation != null ? distributionManagementLocation : ( base != null ? base.distributionManagementLocation : null ),
1571                 propertiesLocation != null ? propertiesLocation : ( base != null ? base.propertiesLocation : null ),
1572                 dependencyManagementLocation != null ? dependencyManagementLocation : ( base != null ? base.dependencyManagementLocation : null ),
1573                 dependenciesLocation != null ? dependenciesLocation : ( base != null ? base.dependenciesLocation : null ),
1574                 repositoriesLocation != null ? repositoriesLocation : ( base != null ? base.repositoriesLocation : null ),
1575                 pluginRepositoriesLocation != null ? pluginRepositoriesLocation : ( base != null ? base.pluginRepositoriesLocation : null ),
1576                 reportingLocation != null ? reportingLocation : ( base != null ? base.reportingLocation : null ),
1577                 pomFileLocation != null ? pomFileLocation : ( base != null ? base.pomFileLocation : null ),
1578                 modelVersionLocation != null ? modelVersionLocation : ( base != null ? base.modelVersionLocation : null ),
1579                 parentLocation != null ? parentLocation : ( base != null ? base.parentLocation : null ),
1580                 groupIdLocation != null ? groupIdLocation : ( base != null ? base.groupIdLocation : null ),
1581                 artifactIdLocation != null ? artifactIdLocation : ( base != null ? base.artifactIdLocation : null ),
1582                 versionLocation != null ? versionLocation : ( base != null ? base.versionLocation : null ),
1583                 packagingLocation != null ? packagingLocation : ( base != null ? base.packagingLocation : null ),
1584                 nameLocation != null ? nameLocation : ( base != null ? base.nameLocation : null ),
1585                 descriptionLocation != null ? descriptionLocation : ( base != null ? base.descriptionLocation : null ),
1586                 urlLocation != null ? urlLocation : ( base != null ? base.urlLocation : null ),
1587                 childProjectUrlInheritAppendPathLocation != null ? childProjectUrlInheritAppendPathLocation : ( base != null ? base.childProjectUrlInheritAppendPathLocation : null ),
1588                 inceptionYearLocation != null ? inceptionYearLocation : ( base != null ? base.inceptionYearLocation : null ),
1589                 organizationLocation != null ? organizationLocation : ( base != null ? base.organizationLocation : null ),
1590                 licensesLocation != null ? licensesLocation : ( base != null ? base.licensesLocation : null ),
1591                 developersLocation != null ? developersLocation : ( base != null ? base.developersLocation : null ),
1592                 contributorsLocation != null ? contributorsLocation : ( base != null ? base.contributorsLocation : null ),
1593                 mailingListsLocation != null ? mailingListsLocation : ( base != null ? base.mailingListsLocation : null ),
1594                 prerequisitesLocation != null ? prerequisitesLocation : ( base != null ? base.prerequisitesLocation : null ),
1595                 scmLocation != null ? scmLocation : ( base != null ? base.scmLocation : null ),
1596                 issueManagementLocation != null ? issueManagementLocation : ( base != null ? base.issueManagementLocation : null ),
1597                 ciManagementLocation != null ? ciManagementLocation : ( base != null ? base.ciManagementLocation : null ),
1598                 buildLocation != null ? buildLocation : ( base != null ? base.buildLocation : null ),
1599                 profilesLocation != null ? profilesLocation : ( base != null ? base.profilesLocation : null )
1600             );
1601         }
1602     }
1603 
1604 
1605             
1606     /**
1607      * Gets the base directory for the corresponding project (if any).
1608      *
1609      * @return The base directory for the corresponding project or {@code null} if this model does not belong to a local
1610      *         project (e.g. describes the metadata of some artifact from the repository).
1611      */
1612     public Path getProjectDirectory()
1613     {
1614         return ( pomFile != null ) ? pomFile.getParent() : null;
1615     }
1616 
1617     /**
1618      * @return the model id as {@code groupId:artifactId:packaging:version}
1619      */
1620     public String getId()
1621     {
1622         StringBuilder id = new StringBuilder( 64 );
1623 
1624         id.append( ( getGroupId() == null ) ? "[inherited]" : getGroupId() );
1625         id.append( ":" );
1626         id.append( getArtifactId() );
1627         id.append( ":" );
1628         id.append( getPackaging() );
1629         id.append( ":" );
1630         id.append( ( getVersion() == null ) ? "[inherited]" : getVersion() );
1631 
1632         return id.toString();
1633     }
1634 
1635     @Override
1636     public String toString()
1637     {
1638         return getId();
1639     }
1640 
1641     public boolean isChildProjectUrlInheritAppendPath()
1642     {
1643         return ( getChildProjectUrlInheritAppendPath() != null ) ? Boolean.parseBoolean( getChildProjectUrlInheritAppendPath() ) : true;
1644     }
1645 
1646             
1647           
1648 }