in src/main/java/org/apache/jackrabbit/filevault/maven/packaging/MavenBasedPackageDependency.java [149:190]
private void resolve(final MavenProject project, final Log log) throws IOException {
if (isResolved) {
return;
} else {
isResolved = true;
}
if (!StringUtils.isEmpty(group) || !StringUtils.isEmpty(name)) {
log.warn("Using package id in dependencies is deprecated. Use Maven coordinates (given via 'groupId' and 'artifactId') instead of '" + group + ":" + name +"'!");
}
if (!StringUtils.isEmpty(groupId) && !StringUtils.isEmpty(artifactId)) {
boolean foundMavenDependency = false;
if (project != null) {
for (Artifact a : project.getDependencyArtifacts()) {
if (a.getArtifactId().equals(artifactId) && a.getGroupId().equals(groupId) && StringUtils.equals(a.getClassifier(), classifier)) {
// check if file exists and if it points to a real file (might also point to a classes dir)
try {
readMetaData(a.getFile(), log);
mavenVersion = a.getVersion();
foundMavenDependency = true;
} catch (IOException e) {
// can not resolve name and group
log.warn("Could not resolve dependency '" + this + "'", e);
return;
}
break;
}
}
if (!foundMavenDependency) {
throw new IOException("Specified dependency '" + this + "' was not found among the Maven dependencies of this project!");
}
} else {
log.warn("Dependency '" + this + "' was given via Maven coordinates but there is no Maven project connected which allows to resolve those.");
return;
}
}
if (StringUtils.isEmpty(group) || StringUtils.isEmpty(name)) {
throw new IOException("Specified dependency " + this + " is not qualified (group and name or groupId and artifactId is missing)!");
}
VersionRange range = StringUtils.isEmpty(version) ? VersionRange.INFINITE : VersionRange.fromString(version);
dependency = new org.apache.jackrabbit.vault.packaging.Dependency(group, name, range);
}