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