Search in sources :

Example 6 with Organization

use of org.apache.maven.model.Organization in project maven-plugins by apache.

the class MultiMavenProjectStub method getOrganization.

/**
 * {@inheritDoc}
 */
public Organization getOrganization() {
    Organization organization = new Organization();
    organization.setName("maven-plugin-tests");
    return organization;
}
Also used : Organization(org.apache.maven.model.Organization)

Example 7 with Organization

use of org.apache.maven.model.Organization in project maven-plugins by apache.

the class ProcessRemoteResourcesMojo method getProjectsSortedByOrganization.

protected Map<Organization, List<MavenProject>> getProjectsSortedByOrganization(List<MavenProject> projects) throws MojoExecutionException {
    Map<Organization, List<MavenProject>> organizations = new TreeMap<Organization, List<MavenProject>>(new OrganizationComparator());
    List<MavenProject> unknownOrganization = new ArrayList<MavenProject>();
    for (MavenProject p : projects) {
        if (p.getOrganization() != null && StringUtils.isNotEmpty(p.getOrganization().getName())) {
            List<MavenProject> sortedProjects = organizations.get(p.getOrganization());
            if (sortedProjects == null) {
                sortedProjects = new ArrayList<MavenProject>();
            }
            sortedProjects.add(p);
            organizations.put(p.getOrganization(), sortedProjects);
        } else {
            unknownOrganization.add(p);
        }
    }
    if (!unknownOrganization.isEmpty()) {
        Organization unknownOrg = new Organization();
        unknownOrg.setName("an unknown organization");
        organizations.put(unknownOrg, unknownOrganization);
    }
    return organizations;
}
Also used : Organization(org.apache.maven.model.Organization) MavenProject(org.apache.maven.project.MavenProject) ArrayList(java.util.ArrayList) List(java.util.List) ArrayList(java.util.ArrayList) TreeMap(java.util.TreeMap)

Aggregations

Organization (org.apache.maven.model.Organization)7 Properties (java.util.Properties)2 MavenProject (org.apache.maven.project.MavenProject)2 ImmutableMap (com.google.common.collect.ImmutableMap)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 List (java.util.List)1 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1 Build (org.apache.maven.model.Build)1 CiManagement (org.apache.maven.model.CiManagement)1 Contributor (org.apache.maven.model.Contributor)1 Dependency (org.apache.maven.model.Dependency)1 DependencyManagement (org.apache.maven.model.DependencyManagement)1 Developer (org.apache.maven.model.Developer)1 DistributionManagement (org.apache.maven.model.DistributionManagement)1 IssueManagement (org.apache.maven.model.IssueManagement)1 License (org.apache.maven.model.License)1 MailingList (org.apache.maven.model.MailingList)1 Model (org.apache.maven.model.Model)1