Search in sources :

Example 6 with LicensedProjects

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());
            }
        }
    }
}
Also used : LicensedProjects(org.apache.hyracks.maven.license.project.LicensedProjects) Project(org.apache.hyracks.maven.license.project.Project) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Example 7 with LicensedProjects

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();
    }
}
Also used : LicensedProjects(org.apache.hyracks.maven.license.project.LicensedProjects) SequenceWriter(com.fasterxml.jackson.databind.SequenceWriter) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Aggregations

LicensedProjects (org.apache.hyracks.maven.license.project.LicensedProjects)7 Project (org.apache.hyracks.maven.license.project.Project)3 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 SequenceWriter (com.fasterxml.jackson.databind.SequenceWriter)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 TreeMap (java.util.TreeMap)1 ArtifactRepository (org.apache.maven.artifact.repository.ArtifactRepository)1 DefaultRepositoryRequest (org.apache.maven.artifact.repository.DefaultRepositoryRequest)1 ArtifactResolutionRequest (org.apache.maven.artifact.resolver.ArtifactResolutionRequest)1