Add guard to artifactoryPublish for JDK5