1
2
3
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 java.util.Objects;
16 import java.util.Optional;
17 import java.util.Set;
18 import java.util.stream.Collectors;
19 import java.util.stream.Stream;
20 import org.apache.maven.api.annotations.Experimental;
21 import org.apache.maven.api.annotations.Generated;
22 import org.apache.maven.api.annotations.Immutable;
23 import org.apache.maven.api.annotations.Nonnull;
24 import org.apache.maven.api.annotations.NotThreadSafe;
25 import org.apache.maven.api.annotations.ThreadSafe;
26
27
28
29
30
31 @Experimental
32 @Generated @ThreadSafe @Immutable
33 public class Model
34 extends ModelBase
35 implements Serializable, InputLocationTracker
36 {
37 final String namespaceUri;
38 final String modelEncoding;
39
40
41
42 final Path pomFile;
43
44
45
46 final String modelVersion;
47
48
49
50
51
52 final Parent parent;
53
54
55
56
57
58 final String groupId;
59
60
61
62
63
64
65 final String artifactId;
66
67
68
69 final String version;
70
71
72
73
74
75
76
77
78
79 final String packaging;
80
81
82
83 final String name;
84
85
86
87
88
89
90
91 final String description;
92
93
94
95
96
97 final String url;
98
99
100
101
102
103
104
105 final String childProjectUrlInheritAppendPath;
106
107
108
109
110
111
112 final boolean root;
113
114
115
116
117
118 final boolean preserveModelVersion;
119
120
121
122
123 final String inceptionYear;
124
125
126
127
128
129 final Organization organization;
130
131
132
133
134
135
136
137
138
139 final List<License> licenses;
140
141
142
143 final List<Developer> developers;
144
145
146
147 final List<Contributor> contributors;
148
149
150
151 final List<MailingList> mailingLists;
152
153
154
155 final Prerequisites prerequisites;
156
157
158
159 final Scm scm;
160
161
162
163 final IssueManagement issueManagement;
164
165
166
167 final CiManagement ciManagement;
168
169
170
171 final Build build;
172
173
174
175
176 final List<Profile> profiles;
177
178
179
180
181
182 protected Model(Builder builder) {
183 super(builder);
184 this.namespaceUri = builder.namespaceUri != null ? builder.namespaceUri : (builder.base != null ? builder.base.namespaceUri : null);
185 this.modelEncoding = builder.modelEncoding != null ? builder.modelEncoding : (builder.base != null ? builder.base.modelEncoding : "UTF-8");
186 this.pomFile = builder.pomFile != null ? builder.pomFile : (builder.base != null ? builder.base.pomFile : null);
187 this.modelVersion = builder.modelVersion != null ? builder.modelVersion : (builder.base != null ? builder.base.modelVersion : null);
188 this.parent = builder.parent != null ? builder.parent : (builder.base != null ? builder.base.parent : null);
189 this.groupId = builder.groupId != null ? builder.groupId : (builder.base != null ? builder.base.groupId : null);
190 this.artifactId = builder.artifactId != null ? builder.artifactId : (builder.base != null ? builder.base.artifactId : null);
191 this.version = builder.version != null ? builder.version : (builder.base != null ? builder.base.version : null);
192 this.packaging = builder.packaging != null ? builder.packaging : (builder.base != null ? builder.base.packaging : null);
193 this.name = builder.name != null ? builder.name : (builder.base != null ? builder.base.name : null);
194 this.description = builder.description != null ? builder.description : (builder.base != null ? builder.base.description : null);
195 this.url = builder.url != null ? builder.url : (builder.base != null ? builder.base.url : null);
196 this.childProjectUrlInheritAppendPath = builder.childProjectUrlInheritAppendPath != null ? builder.childProjectUrlInheritAppendPath : (builder.base != null ? builder.base.childProjectUrlInheritAppendPath : null);
197 this.root = builder.root != null ? builder.root : (builder.base != null ? builder.base.root : false);
198 this.preserveModelVersion = builder.preserveModelVersion != null ? builder.preserveModelVersion : (builder.base != null ? builder.base.preserveModelVersion : false);
199 this.inceptionYear = builder.inceptionYear != null ? builder.inceptionYear : (builder.base != null ? builder.base.inceptionYear : null);
200 this.organization = builder.organization != null ? builder.organization : (builder.base != null ? builder.base.organization : null);
201 this.licenses = ImmutableCollections.copy(builder.licenses != null ? builder.licenses : (builder.base != null ? builder.base.licenses : null));
202 this.developers = ImmutableCollections.copy(builder.developers != null ? builder.developers : (builder.base != null ? builder.base.developers : null));
203 this.contributors = ImmutableCollections.copy(builder.contributors != null ? builder.contributors : (builder.base != null ? builder.base.contributors : null));
204 this.mailingLists = ImmutableCollections.copy(builder.mailingLists != null ? builder.mailingLists : (builder.base != null ? builder.base.mailingLists : null));
205 this.prerequisites = builder.prerequisites != null ? builder.prerequisites : (builder.base != null ? builder.base.prerequisites : null);
206 this.scm = builder.scm != null ? builder.scm : (builder.base != null ? builder.base.scm : null);
207 this.issueManagement = builder.issueManagement != null ? builder.issueManagement : (builder.base != null ? builder.base.issueManagement : null);
208 this.ciManagement = builder.ciManagement != null ? builder.ciManagement : (builder.base != null ? builder.base.ciManagement : null);
209 this.build = builder.build != null ? builder.build : (builder.base != null ? builder.base.build : null);
210 this.profiles = ImmutableCollections.copy(builder.profiles != null ? builder.profiles : (builder.base != null ? builder.base.profiles : null));
211 }
212
213 public String getNamespaceUri() {
214 return namespaceUri;
215 }
216
217 public String getModelEncoding() {
218 return modelEncoding;
219 }
220
221
222
223
224
225
226 public Path getPomFile() {
227 return this.pomFile;
228 }
229
230
231
232
233
234
235 public String getModelVersion() {
236 return this.modelVersion;
237 }
238
239
240
241
242
243
244
245
246 public Parent getParent() {
247 return this.parent;
248 }
249
250
251
252
253
254
255
256
257 public String getGroupId() {
258 return this.groupId;
259 }
260
261
262
263
264
265
266
267
268
269 public String getArtifactId() {
270 return this.artifactId;
271 }
272
273
274
275
276
277
278 public String getVersion() {
279 return this.version;
280 }
281
282
283
284
285
286
287
288
289
290
291
292
293 public String getPackaging() {
294 return this.packaging;
295 }
296
297
298
299
300
301
302 public String getName() {
303 return this.name;
304 }
305
306
307
308
309
310
311
312
313
314
315 public String getDescription() {
316 return this.description;
317 }
318
319
320
321
322
323
324
325
326 public String getUrl() {
327 return this.url;
328 }
329
330
331
332
333
334
335
336
337
338
339 public String getChildProjectUrlInheritAppendPath() {
340 return this.childProjectUrlInheritAppendPath;
341 }
342
343
344
345
346
347
348
349
350
351 public boolean isRoot() {
352 return this.root;
353 }
354
355
356
357
358
359
360
361
362 public boolean isPreserveModelVersion() {
363 return this.preserveModelVersion;
364 }
365
366
367
368
369
370
371
372 public String getInceptionYear() {
373 return this.inceptionYear;
374 }
375
376
377
378
379
380
381
382
383 public Organization getOrganization() {
384 return this.organization;
385 }
386
387
388
389
390
391
392
393
394
395
396
397
398 @Nonnull
399 public List<License> getLicenses() {
400 return this.licenses;
401 }
402
403
404
405
406
407
408 @Nonnull
409 public List<Developer> getDevelopers() {
410 return this.developers;
411 }
412
413
414
415
416
417
418 @Nonnull
419 public List<Contributor> getContributors() {
420 return this.contributors;
421 }
422
423
424
425
426
427
428 @Nonnull
429 public List<MailingList> getMailingLists() {
430 return this.mailingLists;
431 }
432
433
434
435
436
437
438 public Prerequisites getPrerequisites() {
439 return this.prerequisites;
440 }
441
442
443
444
445
446
447 public Scm getScm() {
448 return this.scm;
449 }
450
451
452
453
454
455
456 public IssueManagement getIssueManagement() {
457 return this.issueManagement;
458 }
459
460
461
462
463
464
465 public CiManagement getCiManagement() {
466 return this.ciManagement;
467 }
468
469
470
471
472
473
474 public Build getBuild() {
475 return this.build;
476 }
477
478
479
480
481
482
483
484 @Nonnull
485 public List<Profile> getProfiles() {
486 return this.profiles;
487 }
488
489
490
491
492
493
494 @Nonnull
495 public Builder with() {
496 return newBuilder(this);
497 }
498
499
500
501
502
503
504 @Deprecated
505 @Nonnull
506 public Model withModules(Collection<String> modules) {
507 return newBuilder(this, true).modules(modules).build();
508 }
509
510
511
512
513
514
515 @Nonnull
516 public Model withSubprojects(Collection<String> subprojects) {
517 return newBuilder(this, true).subprojects(subprojects).build();
518 }
519
520
521
522
523
524
525 @Nonnull
526 public Model withDistributionManagement(DistributionManagement distributionManagement) {
527 return newBuilder(this, true).distributionManagement(distributionManagement).build();
528 }
529
530
531
532
533
534
535 @Nonnull
536 public Model withProperties(Map<String, String> properties) {
537 return newBuilder(this, true).properties(properties).build();
538 }
539
540
541
542
543
544
545 @Nonnull
546 public Model withDependencyManagement(DependencyManagement dependencyManagement) {
547 return newBuilder(this, true).dependencyManagement(dependencyManagement).build();
548 }
549
550
551
552
553
554
555 @Nonnull
556 public Model withDependencies(Collection<Dependency> dependencies) {
557 return newBuilder(this, true).dependencies(dependencies).build();
558 }
559
560
561
562
563
564
565 @Nonnull
566 public Model withRepositories(Collection<Repository> repositories) {
567 return newBuilder(this, true).repositories(repositories).build();
568 }
569
570
571
572
573
574
575 @Nonnull
576 public Model withPluginRepositories(Collection<Repository> pluginRepositories) {
577 return newBuilder(this, true).pluginRepositories(pluginRepositories).build();
578 }
579
580
581
582
583
584
585 @Nonnull
586 public Model withReporting(Reporting reporting) {
587 return newBuilder(this, true).reporting(reporting).build();
588 }
589
590
591
592
593
594
595 @Nonnull
596 public Model withPomFile(Path pomFile) {
597 return newBuilder(this, true).pomFile(pomFile).build();
598 }
599
600
601
602
603
604
605 @Nonnull
606 public Model withModelVersion(String modelVersion) {
607 return newBuilder(this, true).modelVersion(modelVersion).build();
608 }
609
610
611
612
613
614
615 @Nonnull
616 public Model withParent(Parent parent) {
617 return newBuilder(this, true).parent(parent).build();
618 }
619
620
621
622
623
624
625 @Nonnull
626 public Model withGroupId(String groupId) {
627 return newBuilder(this, true).groupId(groupId).build();
628 }
629
630
631
632
633
634
635 @Nonnull
636 public Model withArtifactId(String artifactId) {
637 return newBuilder(this, true).artifactId(artifactId).build();
638 }
639
640
641
642
643
644
645 @Nonnull
646 public Model withVersion(String version) {
647 return newBuilder(this, true).version(version).build();
648 }
649
650
651
652
653
654
655 @Nonnull
656 public Model withPackaging(String packaging) {
657 return newBuilder(this, true).packaging(packaging).build();
658 }
659
660
661
662
663
664
665 @Nonnull
666 public Model withName(String name) {
667 return newBuilder(this, true).name(name).build();
668 }
669
670
671
672
673
674
675 @Nonnull
676 public Model withDescription(String description) {
677 return newBuilder(this, true).description(description).build();
678 }
679
680
681
682
683
684
685 @Nonnull
686 public Model withUrl(String url) {
687 return newBuilder(this, true).url(url).build();
688 }
689
690
691
692
693
694
695 @Nonnull
696 public Model withChildProjectUrlInheritAppendPath(String childProjectUrlInheritAppendPath) {
697 return newBuilder(this, true).childProjectUrlInheritAppendPath(childProjectUrlInheritAppendPath).build();
698 }
699
700
701
702
703
704
705 @Nonnull
706 public Model withRoot(boolean root) {
707 return newBuilder(this, true).root(root).build();
708 }
709
710
711
712
713
714
715 @Nonnull
716 public Model withPreserveModelVersion(boolean preserveModelVersion) {
717 return newBuilder(this, true).preserveModelVersion(preserveModelVersion).build();
718 }
719
720
721
722
723
724
725 @Nonnull
726 public Model withInceptionYear(String inceptionYear) {
727 return newBuilder(this, true).inceptionYear(inceptionYear).build();
728 }
729
730
731
732
733
734
735 @Nonnull
736 public Model withOrganization(Organization organization) {
737 return newBuilder(this, true).organization(organization).build();
738 }
739
740
741
742
743
744
745 @Nonnull
746 public Model withLicenses(Collection<License> licenses) {
747 return newBuilder(this, true).licenses(licenses).build();
748 }
749
750
751
752
753
754
755 @Nonnull
756 public Model withDevelopers(Collection<Developer> developers) {
757 return newBuilder(this, true).developers(developers).build();
758 }
759
760
761
762
763
764
765 @Nonnull
766 public Model withContributors(Collection<Contributor> contributors) {
767 return newBuilder(this, true).contributors(contributors).build();
768 }
769
770
771
772
773
774
775 @Nonnull
776 public Model withMailingLists(Collection<MailingList> mailingLists) {
777 return newBuilder(this, true).mailingLists(mailingLists).build();
778 }
779
780
781
782
783
784
785 @Nonnull
786 public Model withPrerequisites(Prerequisites prerequisites) {
787 return newBuilder(this, true).prerequisites(prerequisites).build();
788 }
789
790
791
792
793
794
795 @Nonnull
796 public Model withScm(Scm scm) {
797 return newBuilder(this, true).scm(scm).build();
798 }
799
800
801
802
803
804
805 @Nonnull
806 public Model withIssueManagement(IssueManagement issueManagement) {
807 return newBuilder(this, true).issueManagement(issueManagement).build();
808 }
809
810
811
812
813
814
815 @Nonnull
816 public Model withCiManagement(CiManagement ciManagement) {
817 return newBuilder(this, true).ciManagement(ciManagement).build();
818 }
819
820
821
822
823
824
825 @Nonnull
826 public Model withBuild(Build build) {
827 return newBuilder(this, true).build(build).build();
828 }
829
830
831
832
833
834
835 @Nonnull
836 public Model withProfiles(Collection<Profile> profiles) {
837 return newBuilder(this, true).profiles(profiles).build();
838 }
839
840
841
842
843
844
845
846
847 @Nonnull
848 public static Model newInstance() {
849 return newInstance(true);
850 }
851
852
853
854
855
856
857
858
859 @Nonnull
860 public static Model newInstance(boolean withDefaults) {
861 return newBuilder(withDefaults).build();
862 }
863
864
865
866
867
868
869
870
871 @Nonnull
872 public static Builder newBuilder() {
873 return newBuilder(true);
874 }
875
876
877
878
879
880
881
882 @Nonnull
883 public static Builder newBuilder(boolean withDefaults) {
884 return new Builder(withDefaults);
885 }
886
887
888
889
890
891
892
893
894 @Nonnull
895 public static Builder newBuilder(Model from) {
896 return newBuilder(from, false);
897 }
898
899
900
901
902
903
904
905
906 @Nonnull
907 public static Builder newBuilder(Model from, boolean forceCopy) {
908 return new Builder(from, forceCopy);
909 }
910
911
912
913
914
915
916 @NotThreadSafe
917 public static class Builder
918 extends ModelBase.Builder
919 {
920 Model base;
921 String namespaceUri;
922 String modelEncoding;
923 Path pomFile;
924 String modelVersion;
925 Parent parent;
926 String groupId;
927 String artifactId;
928 String version;
929 String packaging;
930 String name;
931 String description;
932 String url;
933 String childProjectUrlInheritAppendPath;
934 Boolean root;
935 Boolean preserveModelVersion;
936 String inceptionYear;
937 Organization organization;
938 Collection<License> licenses;
939 Collection<Developer> developers;
940 Collection<Contributor> contributors;
941 Collection<MailingList> mailingLists;
942 Prerequisites prerequisites;
943 Scm scm;
944 IssueManagement issueManagement;
945 CiManagement ciManagement;
946 Build build;
947 Collection<Profile> profiles;
948
949 protected Builder(boolean withDefaults) {
950 super(withDefaults);
951 if (withDefaults) {
952 this.packaging = "jar";
953 this.root = false;
954 this.preserveModelVersion = false;
955 }
956 }
957
958 protected Builder(Model base, boolean forceCopy) {
959 super(base, forceCopy);
960 this.namespaceUri = base.namespaceUri;
961 this.modelEncoding = base.modelEncoding;
962 if (forceCopy) {
963 this.pomFile = base.pomFile;
964 this.modelVersion = base.modelVersion;
965 this.parent = base.parent;
966 this.groupId = base.groupId;
967 this.artifactId = base.artifactId;
968 this.version = base.version;
969 this.packaging = base.packaging;
970 this.name = base.name;
971 this.description = base.description;
972 this.url = base.url;
973 this.childProjectUrlInheritAppendPath = base.childProjectUrlInheritAppendPath;
974 this.root = base.root;
975 this.preserveModelVersion = base.preserveModelVersion;
976 this.inceptionYear = base.inceptionYear;
977 this.organization = base.organization;
978 this.licenses = base.licenses;
979 this.developers = base.developers;
980 this.contributors = base.contributors;
981 this.mailingLists = base.mailingLists;
982 this.prerequisites = base.prerequisites;
983 this.scm = base.scm;
984 this.issueManagement = base.issueManagement;
985 this.ciManagement = base.ciManagement;
986 this.build = base.build;
987 this.profiles = base.profiles;
988 this.locations = base.locations;
989 this.importedFrom = base.importedFrom;
990 } else {
991 this.base = base;
992 }
993 }
994
995 @Nonnull
996 public Builder namespaceUri(String namespaceUri) {
997 this.namespaceUri = namespaceUri;
998 return this;
999 }
1000
1001 @Nonnull
1002 public Builder modelEncoding(String modelEncoding) {
1003 this.modelEncoding = modelEncoding;
1004 return this;
1005 }
1006
1007 @Deprecated
1008 @Nonnull
1009 public Builder modules(Collection<String> modules) {
1010 this.modules = modules;
1011 return this;
1012 }
1013
1014 @Nonnull
1015 public Builder subprojects(Collection<String> subprojects) {
1016 this.subprojects = subprojects;
1017 return this;
1018 }
1019
1020 @Nonnull
1021 public Builder distributionManagement(DistributionManagement distributionManagement) {
1022 this.distributionManagement = distributionManagement;
1023 return this;
1024 }
1025
1026 @Nonnull
1027 public Builder properties(Map<String, String> properties) {
1028 this.properties = properties;
1029 return this;
1030 }
1031
1032 @Nonnull
1033 public Builder dependencyManagement(DependencyManagement dependencyManagement) {
1034 this.dependencyManagement = dependencyManagement;
1035 return this;
1036 }
1037
1038 @Nonnull
1039 public Builder dependencies(Collection<Dependency> dependencies) {
1040 this.dependencies = dependencies;
1041 return this;
1042 }
1043
1044 @Nonnull
1045 public Builder repositories(Collection<Repository> repositories) {
1046 this.repositories = repositories;
1047 return this;
1048 }
1049
1050 @Nonnull
1051 public Builder pluginRepositories(Collection<Repository> pluginRepositories) {
1052 this.pluginRepositories = pluginRepositories;
1053 return this;
1054 }
1055
1056 @Nonnull
1057 public Builder reporting(Reporting reporting) {
1058 this.reporting = reporting;
1059 return this;
1060 }
1061
1062 @Nonnull
1063 public Builder pomFile(Path pomFile) {
1064 this.pomFile = pomFile;
1065 return this;
1066 }
1067
1068 @Nonnull
1069 public Builder modelVersion(String modelVersion) {
1070 this.modelVersion = modelVersion;
1071 return this;
1072 }
1073
1074 @Nonnull
1075 public Builder parent(Parent parent) {
1076 this.parent = parent;
1077 return this;
1078 }
1079
1080 @Nonnull
1081 public Builder groupId(String groupId) {
1082 this.groupId = groupId;
1083 return this;
1084 }
1085
1086 @Nonnull
1087 public Builder artifactId(String artifactId) {
1088 this.artifactId = artifactId;
1089 return this;
1090 }
1091
1092 @Nonnull
1093 public Builder version(String version) {
1094 this.version = version;
1095 return this;
1096 }
1097
1098 @Nonnull
1099 public Builder packaging(String packaging) {
1100 this.packaging = packaging;
1101 return this;
1102 }
1103
1104 @Nonnull
1105 public Builder name(String name) {
1106 this.name = name;
1107 return this;
1108 }
1109
1110 @Nonnull
1111 public Builder description(String description) {
1112 this.description = description;
1113 return this;
1114 }
1115
1116 @Nonnull
1117 public Builder url(String url) {
1118 this.url = url;
1119 return this;
1120 }
1121
1122 @Nonnull
1123 public Builder childProjectUrlInheritAppendPath(String childProjectUrlInheritAppendPath) {
1124 this.childProjectUrlInheritAppendPath = childProjectUrlInheritAppendPath;
1125 return this;
1126 }
1127
1128 @Nonnull
1129 public Builder root(boolean root) {
1130 this.root = root;
1131 return this;
1132 }
1133
1134 @Nonnull
1135 public Builder preserveModelVersion(boolean preserveModelVersion) {
1136 this.preserveModelVersion = preserveModelVersion;
1137 return this;
1138 }
1139
1140 @Nonnull
1141 public Builder inceptionYear(String inceptionYear) {
1142 this.inceptionYear = inceptionYear;
1143 return this;
1144 }
1145
1146 @Nonnull
1147 public Builder organization(Organization organization) {
1148 this.organization = organization;
1149 return this;
1150 }
1151
1152 @Nonnull
1153 public Builder licenses(Collection<License> licenses) {
1154 this.licenses = licenses;
1155 return this;
1156 }
1157
1158 @Nonnull
1159 public Builder developers(Collection<Developer> developers) {
1160 this.developers = developers;
1161 return this;
1162 }
1163
1164 @Nonnull
1165 public Builder contributors(Collection<Contributor> contributors) {
1166 this.contributors = contributors;
1167 return this;
1168 }
1169
1170 @Nonnull
1171 public Builder mailingLists(Collection<MailingList> mailingLists) {
1172 this.mailingLists = mailingLists;
1173 return this;
1174 }
1175
1176 @Nonnull
1177 public Builder prerequisites(Prerequisites prerequisites) {
1178 this.prerequisites = prerequisites;
1179 return this;
1180 }
1181
1182 @Nonnull
1183 public Builder scm(Scm scm) {
1184 this.scm = scm;
1185 return this;
1186 }
1187
1188 @Nonnull
1189 public Builder issueManagement(IssueManagement issueManagement) {
1190 this.issueManagement = issueManagement;
1191 return this;
1192 }
1193
1194 @Nonnull
1195 public Builder ciManagement(CiManagement ciManagement) {
1196 this.ciManagement = ciManagement;
1197 return this;
1198 }
1199
1200 @Nonnull
1201 public Builder build(Build build) {
1202 this.build = build;
1203 return this;
1204 }
1205
1206 @Nonnull
1207 public Builder profiles(Collection<Profile> profiles) {
1208 this.profiles = profiles;
1209 return this;
1210 }
1211
1212
1213 @Nonnull
1214 public Builder location(Object key, InputLocation location) {
1215 if (location != null) {
1216 if (!(this.locations instanceof HashMap)) {
1217 this.locations = this.locations != null ? new HashMap<>(this.locations) : new HashMap<>();
1218 }
1219 this.locations.put(key, location);
1220 }
1221 return this;
1222 }
1223
1224 @Nonnull
1225 public Builder importedFrom(InputLocation importedFrom) {
1226 this.importedFrom = importedFrom;
1227 return this;
1228 }
1229
1230 @Nonnull
1231 public Model build() {
1232
1233 if (base != null
1234 && (modules == null || modules == base.modules)
1235 && (subprojects == null || subprojects == base.subprojects)
1236 && (distributionManagement == null || distributionManagement == base.distributionManagement)
1237 && (properties == null || properties == base.properties)
1238 && (dependencyManagement == null || dependencyManagement == base.dependencyManagement)
1239 && (dependencies == null || dependencies == base.dependencies)
1240 && (repositories == null || repositories == base.repositories)
1241 && (pluginRepositories == null || pluginRepositories == base.pluginRepositories)
1242 && (reporting == null || reporting == base.reporting)
1243 && (pomFile == null || pomFile == base.pomFile)
1244 && (modelVersion == null || modelVersion == base.modelVersion)
1245 && (parent == null || parent == base.parent)
1246 && (groupId == null || groupId == base.groupId)
1247 && (artifactId == null || artifactId == base.artifactId)
1248 && (version == null || version == base.version)
1249 && (packaging == null || packaging == base.packaging)
1250 && (name == null || name == base.name)
1251 && (description == null || description == base.description)
1252 && (url == null || url == base.url)
1253 && (childProjectUrlInheritAppendPath == null || childProjectUrlInheritAppendPath == base.childProjectUrlInheritAppendPath)
1254 && (root == null || root == base.root)
1255 && (preserveModelVersion == null || preserveModelVersion == base.preserveModelVersion)
1256 && (inceptionYear == null || inceptionYear == base.inceptionYear)
1257 && (organization == null || organization == base.organization)
1258 && (licenses == null || licenses == base.licenses)
1259 && (developers == null || developers == base.developers)
1260 && (contributors == null || contributors == base.contributors)
1261 && (mailingLists == null || mailingLists == base.mailingLists)
1262 && (prerequisites == null || prerequisites == base.prerequisites)
1263 && (scm == null || scm == base.scm)
1264 && (issueManagement == null || issueManagement == base.issueManagement)
1265 && (ciManagement == null || ciManagement == base.ciManagement)
1266 && (build == null || build == base.build)
1267 && (profiles == null || profiles == base.profiles)
1268 ) {
1269 return base;
1270 }
1271 return new Model(this);
1272 }
1273
1274 }
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284 public Path getProjectDirectory() {
1285 return (pomFile != null) ? pomFile.getParent() : null;
1286 }
1287
1288
1289
1290
1291 public String getId()
1292 {
1293 StringBuilder id = new StringBuilder( 64 );
1294
1295 id.append( ( getGroupId() == null ) ? "[inherited]" : getGroupId() );
1296 id.append( ":" );
1297 id.append( getArtifactId() );
1298 id.append( ":" );
1299 id.append( getPackaging() );
1300 id.append( ":" );
1301 id.append( ( getVersion() == null ) ? "[inherited]" : getVersion() );
1302
1303 return id.toString();
1304 }
1305
1306 @Override
1307 public String toString()
1308 {
1309 return getId();
1310 }
1311
1312 public boolean isChildProjectUrlInheritAppendPath()
1313 {
1314 return ( getChildProjectUrlInheritAppendPath() != null ) ? Boolean.parseBoolean( getChildProjectUrlInheritAppendPath() ) : true;
1315 }
1316
1317
1318
1319 }