@Override
public Dependency resolveProperties(final Dependency dependency)
{
MavenCoreFacet mvn = project.getFacet(MavenCoreFacet.class);
Properties properties = mvn.getPartialProjectBuildingResult().getProject().getProperties();
DependencyBuilder builder = DependencyBuilder.create(dependency);
for (Entry<Object, Object> e : properties.entrySet())
{
String key = "\\$\\{" + e.getKey().toString() + "\\}";
Object value = e.getValue();
if (dependency.getGroupId() != null)
builder.setGroupId(dependency.getGroupId().replaceAll(key, value.toString()));
if (dependency.getArtifactId() != null)
builder.setArtifactId(dependency.getArtifactId().replaceAll(key, value.toString()));
if (dependency.getVersion() != null)
builder.setVersion(dependency.getVersion().replaceAll(key, value.toString()));
if (dependency.getClassifier() != null)
builder.setClassifier(dependency.getClassifier().replaceAll(key, value.toString()));
if (dependency.getPackagingType() != null)
builder.setPackagingType(dependency.getPackagingType().replaceAll(key,
value.toString()));
if (dependency.getScopeType() != null)
builder.setScopeType(dependency.getScopeType().replaceAll(key, value.toString()));
}
return builder;
}