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