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