This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy-release.git


The following commit(s) were added to refs/heads/master by this push:
     new 68dcdf8  add checkMavenStatus task for double-checking all artifacts 
are synced
68dcdf8 is described below

commit 68dcdf850f698c0f7f559e99dfa3d3fbaa317cd9
Author: Paul King <pa...@asert.com.au>
AuthorDate: Thu Jun 2 20:21:10 2022 +1000

    add checkMavenStatus task for double-checking all artifacts are synced
---
 buildSrc/src/main/groovy/HttpUtil.groovy |  7 +++++++
 gradle/adhoc.gradle                      | 23 +++++++++++++++++++----
 2 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/buildSrc/src/main/groovy/HttpUtil.groovy 
b/buildSrc/src/main/groovy/HttpUtil.groovy
index 191771d..9bcf16b 100644
--- a/buildSrc/src/main/groovy/HttpUtil.groovy
+++ b/buildSrc/src/main/groovy/HttpUtil.groovy
@@ -22,6 +22,13 @@ class HttpUtil {
                 .build()
     }
 
+    static HttpRequest headRequest(url) {
+        HttpRequest.newBuilder()
+                .uri(new URI(url))
+                .method("HEAD", HttpRequest.BodyPublishers.noBody())
+                .build()
+    }
+
     static HttpRequest headRequest(url, user, password) {
         HttpRequest.newBuilder()
                 .uri(new URI(url))
diff --git a/gradle/adhoc.gradle b/gradle/adhoc.gradle
index 604279a..8c4e5c4 100644
--- a/gradle/adhoc.gradle
+++ b/gradle/adhoc.gradle
@@ -90,7 +90,7 @@ task setupModules(dependsOn: assumesPropsSet) {
             'groovy-datetime'   : type2,
             'groovy-dateutil'   : type2, 'groovy-docgenerator': type2,
             'groovy-groovydoc'  : type2,
-            'groovy-groovysh'   : type2, 'groovy-jaxb': type2,
+            'groovy-groovysh'   : type2,
             'groovy-jmx'        : type2,
             'groovy-json'       : type2,
             'groovy-jsr223'     : type2, 'groovy-macro': type2,
@@ -105,7 +105,7 @@ task setupModules(dependsOn: assumesPropsSet) {
         modules << ['groovy-json-direct': type2]
     }
     if (relVersion[0] < '4') {
-        modules << ['groovy-bsf': type2]
+        modules << ['groovy-bsf': type2, 'groovy-jaxb': type2]
     }
     if (relVersion[0] >= '3') {
         modules << [
@@ -113,8 +113,8 @@ task setupModules(dependsOn: assumesPropsSet) {
                 'groovy-yaml': type2
         ]
     }
-    if (relVersion.startsWith('4')) {
-        modules += [
+    if (relVersion[0] >= '4') {
+        modules << [
                 'groovy-contracts': type2,
                 'groovy-ginq': type2,
                 'groovy-macro-library': type2,
@@ -144,6 +144,21 @@ task zipFromArtifactory(dependsOn: setupModules) {
     }
 }
 
+task checkMavenStatus(dependsOn: setupModules) {
+    doLast {
+        def prefix = 'https://repo1.maven.org/maven2'
+        def groupId = apacheGroupId ? 'org/apache/groovy' : 
'org/codehaus/groovy'
+        def client = HttpUtil.newClient()
+        println 'Checking repo1 on Maven Central'
+        modules.each { m, suffixes ->
+            def pomUrl = "$prefix/$groupId/$m/$relVersion/$m-${relVersion}.pom"
+            def request = HttpUtil.headRequest(pomUrl)
+            def response = HttpUtil.send(client, request)
+            println "$m ${response.statusCode() == 200 ? 'found' : 'NOT 
found!!!'}"
+        }
+    }
+}
+
 // useful when re-populating artifactory/jcentral from a partial build failure
 task populateFromCentral(dependsOn: setupModules) {
     doLast {

Reply via email to