Skip to content

Instantly share code, notes, and snippets.

View mosamman's full-sized avatar

Mohamed Salah mosamman

  • BlaBlaConnect Ltd.
View GitHub Profile
@mosamman
mosamman / maven-publish-check.gradle
Last active June 5, 2023 03:08
A Simple gradle task to check if the artifact version exists before publishing to maven server.
publish.dependsOn lookForArtifacts
task lookForArtifacts {
group "upload"
doLast {
def pomFileName = "${ARTIFACT_ID}-${ARTIFACT_VERSION}.pom"
def artifactPath = "${ARTIFACT_GROUP.replace(".", "/")}/${ARTIFACT_ID}/${ARTIFACT_VERSION}/${pomFileName}"
def repositoryUrl = "$MAVEN_SERVER/${artifactPath}"