if (manager == null) {
reporter.report(Severity.ERROR, "Cannot generate ACR content, invalid repository manager");
}
MavenArtifactRepository buildRepository = project.getBuildRepository();
StringBuilder result = new StringBuilder("<obr>\n");
/*
* Add capability to represent maven inforamtion
*/
Capability mavenCapability = CapabilityEncoder.builder(CST.MAVEN).
property(CST.GROUP_ID, buildRepository.getArtifact().getGroupId()).
property(CST.ARTIFACT_ID, buildRepository.getArtifact().getArtifactId()).
property(CST.VERSION, buildRepository.getArtifact().getVersion()).
build();
result.append(manager.getHelper().writeCapability(mavenCapability)).append("\n");
/*
* Add capabilities to represent component metadata
*/
CapabilityEncoder encoder = new CapabilityEncoder();
Set<ComponentReference<?>> processed = new HashSet<ComponentReference<?>>();
Set<VersionedReference<?>> referenced = new HashSet<VersionedReference<?>>();
for (ComponentDeclaration component : buildRepository.getComponents()) {
if (processed.contains(component.getReference())) {
reporter.report(Severity.WARNING,"Component " + component.getName() + " already defined in this build, declaration ignored "+component);
continue;
}