Class MavenProjectLicenses

    • Constructor Detail

      • MavenProjectLicenses

        public MavenProjectLicenses​(org.apache.maven.execution.MavenSession session,
                                    org.apache.maven.project.MavenProject project,
                                    org.apache.maven.shared.dependency.graph.DependencyGraphBuilder graph,
                                    org.apache.maven.project.ProjectBuilder projectBuilder,
                                    List<String> scopes,
                                    org.apache.maven.plugin.logging.Log log)
        Parameters:
        session - the current MavenSession
        graph - the DependencyGraphBuilder implementation
        projectBuilder - the maven ProjectBuilder implementation
    • Method Detail

      • getLicensesFromArtifact

        protected Set<org.apache.maven.model.License> getLicensesFromArtifact​(org.apache.maven.artifact.Artifact artifact)
        Return a set of licenses attributed to a single artifact.
      • getLicenseMapFromArtifacts

        protected Map<org.apache.maven.model.License,​Set<org.apache.maven.artifact.Artifact>> getLicenseMapFromArtifacts​(Set<org.apache.maven.artifact.Artifact> dependencies)
        Get mapping of Licenses to a set of artifacts presenting that license.
        Parameters:
        dependencies - Set to collate License entries from
        Returns:
        the same artifacts passed in, keyed by license
      • getLicenseMap

        public Map<org.apache.maven.model.License,​Set<org.apache.maven.artifact.Artifact>> getLicenseMap()
        Specified by:
        getLicenseMap in interface LicenseMap
      • getProjects

        protected Set<org.apache.maven.project.MavenProject> getProjects()
      • setProjects

        protected void setProjects​(Set<org.apache.maven.project.MavenProject> projects)