in src/main/java/org/apache/sling/provisioning/model/ModelUtility.java [323:347]
public static Model applyArtifactVersions(final Model model, final ArtifactVersionResolver resolver) {
// define a processor that updates the versions of artifacts
ModelProcessor versionUpdater = new ModelProcessor() {
@Override
protected Artifact processArtifact(Artifact artifact, Feature newFeature, RunMode newRunMode) {
String newVersion = resolveArtifactVersion(
artifact.getGroupId(),
artifact.getArtifactId(),
artifact.getVersion(),
artifact.getClassifier(),
artifact.getType(),
resolver);
return new Artifact(artifact.getGroupId(),
artifact.getArtifactId(),
newVersion,
artifact.getClassifier(),
artifact.getType(),
artifact.getMetadata());
}
};
// return model with updated version artifacts
return versionUpdater.process(model);
}