com.github.misterreg.mavenplugins.buildgraph.MaskHelper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of build-graph-maven-plugin Show documentation
Show all versions of build-graph-maven-plugin Show documentation
Maven plugin that can create pictures of maven project execution graph.
The newest version!
package com.github.misterreg.mavenplugins.buildgraph;
import org.apache.maven.model.Dependency;
import org.apache.maven.project.MavenProject;
public class MaskHelper {
/**
* supported patterns
* $groupId
* $artifactId
* $vertex
* @param mask
*/
private String mask;
public MaskHelper (String mask) {
this.mask = mask;
}
private String getKey (String groupId, String artifactId, String version) {
return mask
.replace("$groupId", groupId)
.replace("$artifactId", artifactId)
.replace("$version", version);
}
public String getDependencyKey(Dependency d) {
return getKey(d.getGroupId(), d.getArtifactId(), d.getVersion());
}
public String getProjectKey (MavenProject prj) {
return getKey(prj.getGroupId(), prj.getArtifactId(), prj.getVersion());
}
}