}
private void checkCanPublish(String publicationName, MavenArtifact artifact) {
File artifactFile = artifact.getFile();
if (artifactFile == null || !artifactFile.exists()) {
throw new InvalidMavenPublicationException(publicationName, String.format("artifact file does not exist: '%s'", artifactFile));
}
if (artifactFile.isDirectory()) {
throw new InvalidMavenPublicationException(publicationName, String.format("artifact file is a directory: '%s'", artifactFile));
}
}