URL url = getClass().getResource(path);
// If we can not find the metadata, then bitch and return whatever we can
if (url == null) {
log.warn("Missing plugin project metadata: {}", path);
return new GAVCoordinate(groupId, artifactId, UNKNOWN);
}
Properties props = Properties2.load(url);
@NonNls
GAVCoordinate gav = new GAVCoordinate(
props.getProperty("groupId", UNKNOWN),
props.getProperty("artifactId", UNKNOWN),
props.getProperty("version", UNKNOWN)
);
// Complain if there is a mismatch between what we expect the gav to be and what it really is
if (!groupId.equals(gav.getGroupId())) {
log.warn("Plugin groupId mismatch; expected: {}, found: {}", groupId, gav.getGroupId()); //NON-NLS
}
if (!artifactId.equals(gav.getArtifactId())) {
log.warn("Plugin artifactId mismatch; expected: {}, found: {}", artifactId, gav.getArtifactId()); //NON-NLS
}
return gav;
}