"Unexpected metadata request '%s' for this provider",
metadataId);
// Just rebuild on demand. We always do this as we expect
// MetadataService to cache on our behalf
final Pom pom = pomManagementService
.getPomFromModuleName(ProjectMetadata.getModuleName(metadataId));
// Read the file, if it is available
if (pom == null || !fileManager.exists(pom.getPath())) {
return null;
}
final JavaPackage topLevelPackage = new JavaPackage(pom.getGroupId());
// Update UAA with the project name
uaaRegistrationService.registerProject(
UaaRegistrationService.SPRING_ROO,
topLevelPackage.getFullyQualifiedPackageName());
// Update UAA with the well-known Spring-related open source
// dependencies
for (final ProductInfo productInfo : uaaDetectedProducts
.getDetectedProductInfos()) {
if (productInfo.getProductName().equals(
UaaRegistrationService.SPRING_ROO.getName())) {
// No need to register with a less robust pom.xml-declared
// dependency metadata when we did it ourselves with a proper
// bundle version number lookup a moment ago...
continue;
}
if (productInfo.getProductName().equals(
UaaDetectedProducts.SPRING_UAA.getProductName())) {
// No need to register Spring UAA as this happens automatically
// internal to UAA
continue;
}
final Dependency dependency = new Dependency(
productInfo.getGroupId(), productInfo.getArtifactId(),
"version_is_ignored_for_searching");
final Set<Dependency> dependenciesExcludingVersion = pom
.getDependenciesExcludingVersion(dependency);
if (!dependenciesExcludingVersion.isEmpty()) {
// This dependency was detected
final Dependency first = dependenciesExcludingVersion
.iterator().next();
// Convert the detected dependency into a Product as best we can
String versionSequence = first.getVersion();
// Version sequence given; see if it looks like a property
if (versionSequence != null && versionSequence.startsWith("${")
&& versionSequence.endsWith("}")) {
// Strip the ${ } from the version sequence
final String propertyName = versionSequence.replace("${",
"").replace("}", "");
final Set<Property> prop = pom
.getPropertiesExcludingValue(new Property(
propertyName));
if (!prop.isEmpty()) {
// Take the first one's value and treat that as the
// version sequence