use of org.apache.hyracks.maven.license.project.LicensedProjects in project asterixdb by apache.
the class GenerateFileMojo method readExtraMaps.
private void readExtraMaps() throws IOException {
final ObjectMapper objectMapper = new ObjectMapper();
for (ExtraLicenseFile extraLicenseFile : extraLicenseMaps) {
for (LicensedProjects projects : objectMapper.readValue(extraLicenseFile.getFile(), LicensedProjects[].class)) {
LicenseSpec spec = urlToLicenseMap.get(projects.getLicense().getUrl());
if (spec != null) {
// propagate any license content we may have with what already has been loaded
if (projects.getLicense().getContent() != null && spec.getContent() == null) {
spec.setContent(projects.getLicense().getContent());
}
// propagate any license displayName we may have with what already has been loaded
if (projects.getLicense().getDisplayName() != null && spec.getDisplayName() == null) {
spec.setDisplayName(projects.getLicense().getDisplayName());
}
}
for (Project p : projects.getProjects()) {
p.setLocation(extraLicenseFile.getLocation());
addProject(p, projects.getLicense(), extraLicenseFile.isAdditive());
}
}
}
}
use of org.apache.hyracks.maven.license.project.LicensedProjects in project asterixdb by apache.
the class GenerateFileMojo method persistLicenseMap.
private void persistLicenseMap() throws IOException {
if (licenseMapOutputFile != null) {
licenseMapOutputFile.getParentFile().mkdirs();
SequenceWriter sw = new ObjectMapper().writerWithDefaultPrettyPrinter().writeValues(licenseMapOutputFile).init(true);
for (LicensedProjects entry : licenseMap.values()) {
sw.write(entry);
}
sw.close();
}
}
Aggregations