Search in sources :

Example 6 with Project

use of org.apache.hyracks.maven.license.project.Project 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)

Aggregations

Project (org.apache.hyracks.maven.license.project.Project)6 LicensedProjects (org.apache.hyracks.maven.license.project.LicensedProjects)3 MavenProject (org.apache.maven.project.MavenProject)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 File (java.io.File)1 MalformedURLException (java.net.MalformedURLException)1 URL (java.net.URL)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 TreeMap (java.util.TreeMap)1 MutableBoolean (org.apache.commons.lang3.mutable.MutableBoolean)1 ImmutablePair (org.apache.commons.lang3.tuple.ImmutablePair)1 Artifact (org.apache.maven.artifact.Artifact)1 DefaultArtifact (org.apache.maven.artifact.DefaultArtifact)1 ArtifactRepository (org.apache.maven.artifact.repository.ArtifactRepository)1 ArtifactResolutionResult (org.apache.maven.artifact.resolver.ArtifactResolutionResult)1