Slackbot
06/15/2023, 8:06 AMVampire
06/15/2023, 8:07 AMpublishToMavenLocal on CI to capture that.Remco Mokveld
06/15/2023, 8:08 AMRemco Mokveld
06/15/2023, 8:08 AMRemco Mokveld
06/15/2023, 8:11 AMRemco Mokveld
06/15/2023, 8:14 AMcheck taskVampire
06/15/2023, 8:50 AMPublishToMavenLocal tasks that records the published coordinates and fails if a second one publishes the same coordinates or something like that.Adam
06/15/2023, 9:16 AMRemco Mokveld
06/15/2023, 10:03 AMBenjamin Hoogterp
06/15/2023, 1:02 PM./gradlew checkVersion
tasks.register("checkVersion") {
doLast {
var id = version.replace("-SNAPSHOT", "")
var groupPath = project.group.replace(".", "/")
var url = "$releaseRepoUrl/$groupPath/$artifactId/${id}/$artifactId-${id}.pom"
println "Verifying: $url"
var auth = "${nexusUserName}:${nexusPassword}"
def baseUrl = new URL(url)
HttpURLConnection connection = (HttpURLConnection) baseUrl.openConnection()
connection.addRequestProperty("Authorization", "Basic ${auth.bytes.encodeBase64().toString()}")
connection.with {
doOutput = true
requestMethod = "GET"
println "Result: " + it.responseCode
if (it.responseCode == 200)
throw new GradleException("*********************\n Version must be updated for release: [$id].\n Artifact already exists: $url")
}
}
}Vampire
06/15/2023, 1:29 PMBenjamin Hoogterp
06/15/2023, 1:32 PM