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;
}
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;
}
Aggregations