Skip to content

Commit 4e14f6c

Browse files
chore: generate libraries at Thu Jul 24 16:12:02 UTC 2025
1 parent 1ae9b9c commit 4e14f6c

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

.github/scripts/update_generation_config.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
set -ex
2+
set -e
33
# This script should be run at the root of the repository.
44
# This script is used to update googleapis_commitish, gapic_generator_version,
55
# and libraries_bom_version in generation configuration at the time of running
@@ -15,10 +15,8 @@ set -ex
1515
function get_latest_released_version() {
1616
local group_id=$1
1717
local artifact_id=$2
18-
group_id_url_path="$(sed 's|\.|/|g' <<< "${group_id}")"
19-
url="https://repo1.maven.org/maven2/${group_id_url_path}/${artifact_id}/maven-metadata.xml"
20-
xml_content=$(curl -s --fail "${url}")
21-
latest=$(xmllint --xpath 'metadata/versioning/latest/text()' - <<< "${xml_content}")
18+
json_content=$(curl -s "https://search.maven.org/solrsearch/select?q=g:${group_id}+AND+a:${artifact_id}&core=gav&rows=500&wt=json")
19+
latest=$(jq -r '.response.docs[] | select(.v | test("^[0-9]+(\\.[0-9]+)*$")) | .v' <<< "${json_content}" | sort -V | tail -n 1)
2220
if [[ -z "${latest}" ]]; then
2321
echo "The latest version of ${group_id}:${artifact_id} is empty."
2422
echo "The returned json from maven.org is invalid: ${json_content}"

0 commit comments

Comments
 (0)