@Override
public void validate() throws DeploymentFailureException {
super.validate();
if (artifactId == null) {
throw new DeploymentFailureException("undeploy-artifact must specify the artifactId");
}
if (groupId == null) {
throw new DeploymentFailureException("undeploy-artifact must specify the groupId");
}
@SuppressWarnings("unchecked")
final Set<Artifact> dependencies = project.getArtifacts();
Artifact artifact = null;
for (final Artifact a : dependencies) {
if (a.getArtifactId().equals(artifactId) &&
a.getGroupId().equals(groupId)) {
artifact = a;
break;
}
}
if (artifact == null) {
throw new DeploymentFailureException("Could not resolve artifact to deploy %s:%s", groupId, artifactId);
}
file = artifact.getFile();
}