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

ppalaga pushed a commit to branch 2.13.x
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit c31bb90aa5e9bef738279e27d91137293a5ff812
Author: Peter Palaga <ppal...@redhat.com>
AuthorDate: Sun Apr 30 21:39:07 2023 +0200

    Patch mvnw with maven-resolver-1.9.8 artifacts so that it honors 
aether.connector.http.connectionMaxTtl to avoid Connect timeouts on GH actions
---
 .github/workflows/camel-master-cron.yaml   | 14 +++++++++
 .github/workflows/ci-build.yaml            | 42 +++++++++++++++++++++++++++
 .github/workflows/pr-validate.yml          |  7 +++++
 .github/workflows/quarkus-master-cron.yaml | 14 +++++++++
 patch-mvnw.sh                              | 46 ++++++++++++++++++++++++++++++
 5 files changed, 123 insertions(+)

diff --git a/.github/workflows/camel-master-cron.yaml 
b/.github/workflows/camel-master-cron.yaml
index 974541cd65..f77da82042 100644
--- a/.github/workflows/camel-master-cron.yaml
+++ b/.github/workflows/camel-master-cron.yaml
@@ -70,6 +70,13 @@ jobs:
           git fetch origin main
           git rebase origin/main
           git rev-parse origin/main > ~/build-data/main-sha.txt
+      - name: Patch mvnw
+        run: |
+          # This can be removed after upgrading to Maven 3.9.2
+          # make sure mvnw is installed
+          ./mvnw -v
+          # upgrade maven-resolver artifacts
+          ./patch-mvnw.sh
       - name: Build Camel Quarkus
         run: |
           ./mvnw ${CQ_MAVEN_ARGS} clean install -Papache-snapshots 
--fail-at-end
@@ -129,6 +136,13 @@ jobs:
           git config --local user.name "github-actions[bot]"
           git fetch origin main
           git rebase $(cat ~/build-data/main-sha.txt)
+      - name: Patch mvnw
+        run: |
+          # This can be removed after upgrading to Maven 3.9.2
+          # make sure mvnw is installed
+          ./mvnw -v
+          # upgrade maven-resolver artifacts
+          ./patch-mvnw.sh
       - name: Integration Tests
         run: |
           for MODULE in $(yq -M -N e ".${{ matrix.category }}" 
tooling/scripts/test-categories.yaml | cut -f2 -d' '); do
diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml
index f0c7d0b056..2889125303 100644
--- a/.github/workflows/ci-build.yaml
+++ b/.github/workflows/ci-build.yaml
@@ -89,6 +89,13 @@ jobs:
             && ./mvnw ${CQ_MAVEN_ARGS} clean install -Dquickly
       - name: Checkout
         uses: actions/checkout@v2
+      - name: Patch mvnw
+        run: |
+          # This can be removed after upgrading to Maven 3.9.2
+          # make sure mvnw is installed
+          ./mvnw -v
+          # upgrade maven-resolver artifacts
+          ./patch-mvnw.sh
       - name: mvn clean install -DskipTests
         run: |
           eval ./mvnw ${CQ_MAVEN_ARGS} ${BRANCH_OPTIONS} clean install 
-DskipTests -Dquarkus.build.skip
@@ -152,6 +159,13 @@ jobs:
           df -h /
           tar -xzf ../maven-repo.tgz -C ~
           df -h /
+      - name: Patch mvnw
+        run: |
+          # This can be removed after upgrading to Maven 3.9.2
+          # make sure mvnw is installed
+          ./mvnw -v
+          # upgrade maven-resolver artifacts
+          ./patch-mvnw.sh
       - name: Integration Tests
         run: |
           for MODULE in $(yq -M -N e ".${{ matrix.category }}" 
tooling/scripts/test-categories.yaml | cut -f2 -d' '); do
@@ -225,6 +239,13 @@ jobs:
           df -h /
           tar -xzf ../maven-repo.tgz -C ~
           df -h /
+      - name: Patch mvnw
+        run: |
+          # This can be removed after upgrading to Maven 3.9.2
+          # make sure mvnw is installed
+          ./mvnw -v
+          # upgrade maven-resolver artifacts
+          ./patch-mvnw.sh
       - name: cd extensions-core && mvn test
         run: |
           cd extensions-core
@@ -298,6 +319,13 @@ jobs:
           echo "HOSTS_LINE=$HOSTS_LINE"
           echo "${HOSTS_LINE}" | sudo tee -a /etc/hosts
           cat /etc/hosts
+      - name: Patch mvnw
+        run: |
+          # This can be removed after upgrading to Maven 3.9.2
+          # make sure mvnw is installed
+          ./mvnw -v
+          # upgrade maven-resolver artifacts
+          ./patch-mvnw.sh
       - name: cd integration-tests-jvm && mvn clean test
         run: |
           cd integration-tests-jvm
@@ -346,6 +374,13 @@ jobs:
           df -h /
           tar -xzf ../maven-repo.tgz -C ~
           df -h /
+      - name: Patch mvnw
+        run: |
+          # This can be removed after upgrading to Maven 3.9.2
+          # make sure mvnw is installed
+          ./mvnw -v
+          # upgrade maven-resolver artifacts
+          ./patch-mvnw.sh
       - name: cd integration-tests && mvn clean verify
         run: |
           cd integration-tests
@@ -390,6 +425,13 @@ jobs:
         shell: bash
         run: |
           tar -xzf ../maven-repo.tgz -C ~
+      - name: Patch mvnw
+        run: |
+          # This can be removed after upgrading to Maven 3.9.2
+          # make sure mvnw is installed
+          ./mvnw -v
+          # upgrade maven-resolver artifacts
+          ./patch-mvnw.sh
       - name: cd integration-tests && mvn clean verify
         shell: bash
         run: |
diff --git a/.github/workflows/pr-validate.yml 
b/.github/workflows/pr-validate.yml
index 2021f5a5d5..793f0f5578 100644
--- a/.github/workflows/pr-validate.yml
+++ b/.github/workflows/pr-validate.yml
@@ -59,6 +59,13 @@ jobs:
       with:
         distribution: 'temurin'
         java-version: '11'
+    - name: Patch mvnw
+      run: |
+        # This can be removed after upgrading to Maven 3.9.2
+        # make sure mvnw is installed
+        ./mvnw -v
+        # upgrade maven-resolver artifacts
+        ./patch-mvnw.sh
     - name: mvn validate
       run: |
         ./mvnw ${CQ_MAVEN_ARGS} ${BRANCH_OPTIONS} -fae \
diff --git a/.github/workflows/quarkus-master-cron.yaml 
b/.github/workflows/quarkus-master-cron.yaml
index b08288c01e..c3de4bdc6c 100644
--- a/.github/workflows/quarkus-master-cron.yaml
+++ b/.github/workflows/quarkus-master-cron.yaml
@@ -76,6 +76,13 @@ jobs:
             && cd quarkus \
             && echo "Current Quarkus commit:" $(git rev-parse HEAD) \
             && ./mvnw ${CQ_MAVEN_ARGS} clean install -Dquickly
+      - name: Patch mvnw
+        run: |
+          # This can be removed after upgrading to Maven 3.9.2
+          # make sure mvnw is installed
+          ./mvnw -v
+          # upgrade maven-resolver artifacts
+          ./patch-mvnw.sh
       - name: Build Camel Quarkus
         run: |
           ./mvnw ${CQ_MAVEN_ARGS} clean install -Dquarkus.version=999-SNAPSHOT 
--fail-at-end
@@ -138,6 +145,13 @@ jobs:
           git config --local user.name "github-actions[bot]"
           git fetch origin main
           git rebase $(cat ~/build-data/main-sha.txt)
+      - name: Patch mvnw
+        run: |
+          # This can be removed after upgrading to Maven 3.9.2
+          # make sure mvnw is installed
+          ./mvnw -v
+          # upgrade maven-resolver artifacts
+          ./patch-mvnw.sh
       - name: Integration Tests
         run: |
           for MODULE in $(yq -M -N e ".${{ matrix.category }}" 
tooling/scripts/test-categories.yaml | cut -f2 -d' '); do
diff --git a/patch-mvnw.sh b/patch-mvnw.sh
new file mode 100755
index 0000000000..7a914cb1ac
--- /dev/null
+++ b/patch-mvnw.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+
+# A script to replace maven-resolver 1.9.7 artifacts with 1.9.8 ones
+# This is to be able to set aether.connector.http.connectionMaxTtl
+# which is supported only since 1.9.8
+# This is motivated by https://github.com/apache/camel-quarkus/issues/4842
+# This workaround can be removed after the upgrade to Maven 3.9.2
+
+#set -x
+set -e
+
+cd ~/.m2/wrapper/dists/apache-maven-3.9.1-bin/*/apache-maven-3.9.1/lib
+for oldJar in maven-resolver-*-1.9.7.jar; do
+    if [ "$oldJar" != 'maven-resolver-*-1.9.7.jar' ]; then
+        base="${oldJar/%-1.9.7.jar}"
+        echo $base
+        newJar="$base-1.9.8.jar"
+        if [[ ! -f "$newJar" ]]
+        then
+            echo "Downloading $newJar"
+            curl -s -O 
"https://repo1.maven.org/maven2/org/apache/maven/resolver/$base/1.9.8/$newJar";
+        fi
+        if [[ -f "$oldJar" ]]
+        then
+            echo "Deleting $oldJar"
+            rm "$oldJar"
+        fi
+    fi
+done

Reply via email to