From c443bc40fa997262b9057c8c50e205e73099c7e3 Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Wed, 12 May 2021 18:02:35 +0200 Subject: [PATCH] Use MAVEN_OPTS to setup timeouts for dependency downloads (#11250) Motivation: Just use MAVEN_OPTS to setup all the timeouts etc for dependency downloads. This way we at least can be sure these are applied. Modifications: - Use MAVEN_OPTS - Remove ci profile - Remove unused settings.xml file - Always use ./mvnw Result: Build stability improvements --- .github/scripts/release_rollback.sh | 2 +- .github/workflows/ci-build.yml | 3 +++ .github/workflows/ci-deploy.yml | 5 ++++- .github/workflows/ci-pr-reports.yml | 3 +++ .github/workflows/ci-pr.yml | 7 +++++-- .github/workflows/ci-release.yml | 12 +++++++++--- .github/workflows/codeql-analysis.yml | 6 +++++- .mvn/settings.xml | 9 --------- docker/docker-compose.centos-7.yaml | 17 +++++++++-------- docker/docker-compose.yaml | 9 +++++---- pom.xml | 8 -------- 11 files changed, 44 insertions(+), 37 deletions(-) delete mode 100644 .mvn/settings.xml diff --git a/.github/scripts/release_rollback.sh b/.github/scripts/release_rollback.sh index c0b1deb643..d98951ef11 100755 --- a/.github/scripts/release_rollback.sh +++ b/.github/scripts/release_rollback.sh @@ -10,5 +10,5 @@ TAG=$(grep scm.tag= "$1" | cut -d'=' -f2) git remote set-url origin git@github.com:"$2".git git fetch git checkout "$3" -mvn -B --file pom.xml release:rollback +./mvnw -B --file pom.xml release:rollback git push origin :"$TAG" diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index c1efeb8385..e052356123 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -10,6 +10,9 @@ on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: +env: + MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryhandler.count=5 -Dmaven.wagon.httpconnectionManager.ttlSeconds=240 + jobs: build: runs-on: ubuntu-latest diff --git a/.github/workflows/ci-deploy.yml b/.github/workflows/ci-deploy.yml index 1f67681caa..160e940786 100644 --- a/.github/workflows/ci-deploy.yml +++ b/.github/workflows/ci-deploy.yml @@ -10,6 +10,9 @@ on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: +env: + MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryhandler.count=5 -Dmaven.wagon.httpconnectionManager.ttlSeconds=240 + jobs: stage-snapshot: runs-on: ubuntu-latest @@ -122,4 +125,4 @@ jobs: }] - name: Deploy local staged artifacts - run: mvn -B --file pom.xml -Pci org.sonatype.plugins:nexus-staging-maven-plugin:deploy-staged -DaltStagingDirectory=$LOCAL_STAGING_DIR \ No newline at end of file + run: ./mvnw -B --file pom.xml org.sonatype.plugins:nexus-staging-maven-plugin:deploy-staged -DaltStagingDirectory=$LOCAL_STAGING_DIR \ No newline at end of file diff --git a/.github/workflows/ci-pr-reports.yml b/.github/workflows/ci-pr-reports.yml index bfccf55edd..aa59836728 100644 --- a/.github/workflows/ci-pr-reports.yml +++ b/.github/workflows/ci-pr-reports.yml @@ -4,6 +4,9 @@ on: workflows: [ "Build PR" ] types: - completed +env: + MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryhandler.count=5 -Dmaven.wagon.httpconnectionManager.ttlSeconds=240 + jobs: tests: runs-on: ubuntu-latest diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index ede5e7fd99..6baca7e605 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -7,6 +7,9 @@ on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: +env: + MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryhandler.count=5 -Dmaven.wagon.httpconnectionManager.ttlSeconds=240 + jobs: verify-pr: runs-on: ubuntu-18.04 @@ -26,7 +29,7 @@ jobs: ${{ runner.os }}-maven-verify-pr- ${{ runner.os }}-maven- - name: Verify with Maven - run: mvn verify -B --file pom.xml -Pci -DskipTests=true + run: ./mvnw verify -B --file pom.xml -DskipTests=true build-pr-aarch64: name: linux-aarch64-verify-native @@ -71,7 +74,7 @@ jobs: # # Use tcnative.classifier that is empty as we don't support using the shared lib version on ubuntu. run: | - JAVA_HOME=/usr/lib/jvm/java-11-openjdk-arm64 mvn -Pci -pl testsuite-native -am clean package -DskipTests=true -Dcheckstyle.skip=true -DskipNativeTestsuite=false -Dtcnative.classifier= + JAVA_HOME=/usr/lib/jvm/java-11-openjdk-arm64 ./mvnw -pl testsuite-native -am clean package -DskipTests=true -Dcheckstyle.skip=true -DskipNativeTestsuite=false -Dtcnative.classifier= build-pr: runs-on: ubuntu-latest diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml index be3adf45a8..9b9335ddd1 100644 --- a/.github/workflows/ci-release.yml +++ b/.github/workflows/ci-release.yml @@ -5,6 +5,9 @@ on: # Releases can only be triggered via the action tab workflow_dispatch: +env: + MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryhandler.count=5 -Dmaven.wagon.httpconnectionManager.ttlSeconds=240 + jobs: prepare-release: runs-on: ubuntu-18.04 @@ -41,8 +44,8 @@ jobs: - name: Prepare release with Maven run: | - mvn -B --file pom.xml -Pci release:prepare -DpreparationGoals=clean -DskipTests=true - mvn -Pci clean + ./mvnw -B --file pom.xml release:prepare -DpreparationGoals=clean -DskipTests=true + ./mvnw clean - name: Checkout tag run: ./.github/scripts/release_checkout_tag.sh release.properties @@ -161,6 +164,9 @@ jobs: name: prepare-release-workspace path: ./prepare-release-workspace/ + - name: Adjust mvnw permissions + run: chmod 755 ./prepare-release-workspace/mvnw + - name: Set up JDK 8 uses: actions/setup-java@v1 with: @@ -219,7 +225,7 @@ jobs: - name: Deploy local staged artifacts working-directory: ./prepare-release-workspace/ # If we don't want to close the repository we can add -DskipStagingRepositoryClose=true - run: mvn -Pci -B --file pom.xml org.sonatype.plugins:nexus-staging-maven-plugin:deploy-staged -DnexusUrl=https://oss.sonatype.org -DserverId=sonatype-nexus-staging -DaltStagingDirectory=/home/runner/local-staging -DskipStagingRepositoryClose=true + run: ./mvnw -B --file pom.xml org.sonatype.plugins:nexus-staging-maven-plugin:deploy-staged -DnexusUrl=https://oss.sonatype.org -DserverId=sonatype-nexus-staging -DaltStagingDirectory=/home/runner/local-staging -DskipStagingRepositoryClose=true - name: Rollback release on failure working-directory: ./prepare-release-workspace/ diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 7f639643d0..764890afc1 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -14,6 +14,9 @@ on: schedule: - cron: '0 13 * * 3' +env: + MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryhandler.count=5 -Dmaven.wagon.httpconnectionManager.ttlSeconds=240 + jobs: analyze: name: Analyze @@ -73,7 +76,8 @@ jobs: # and modify them (or add more) to build your code if your project # uses a compiled language - - run: ./mvnw -Pci clean package -DskipTests=true -ntp -B + - name: Compile project + run: ./mvnw clean package -DskipTests=true -ntp -B - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v1 diff --git a/.mvn/settings.xml b/.mvn/settings.xml deleted file mode 100644 index 1f7f6fafec..0000000000 --- a/.mvn/settings.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - sonatype-nexus-snapshots - ${env.SANOTYPE_USER} - ${env.SANOTYPE_PASSWORD} - - - diff --git a/docker/docker-compose.centos-7.yaml b/docker/docker-compose.centos-7.yaml index 6b202c364c..b03e125740 100644 --- a/docker/docker-compose.centos-7.yaml +++ b/docker/docker-compose.centos-7.yaml @@ -15,6 +15,11 @@ services: cross-compile-aarch64-common: &cross-compile-aarch64-common depends_on: [ cross-compile-aarch64-runtime-setup ] image: netty:cross_compile_aarch64 + environment: + - GPG_KEYNAME + - GPG_PASSPHRASE + - GPG_PRIVATE_KEY + - MAVEN_OPTS volumes: - ~/.ssh:/root/.ssh - ~/.gnupg:/root/.gnupg @@ -24,7 +29,7 @@ services: cross-compile-aarch64-deploy: <<: *cross-compile-aarch64-common - command: /bin/bash -cl "./mvnw -Pci,linux-aarch64 -pl transport-native-unix-common,transport-native-epoll -am clean deploy -DskipTests=true" + command: /bin/bash -cl "./mvnw -Plinux-aarch64 -pl transport-native-unix-common,transport-native-epoll -am clean deploy -DskipTests=true" cross-compile-aarch64-stage-snapshot: <<: *cross-compile-aarch64-common @@ -34,20 +39,16 @@ services: - ~/.m2:/root/.m2 - ~/local-staging:/root/local-staging - ..:/code - command: /bin/bash -cl "./mvnw -Pci,linux-aarch64 -pl transport-native-unix-common,transport-native-epoll -am clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true" + command: /bin/bash -cl "./mvnw -Plinux-aarch64 -pl transport-native-unix-common,transport-native-epoll -am clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true" cross-compile-aarch64-stage-release: <<: *cross-compile-aarch64-common - environment: - - GPG_KEYNAME - - GPG_PASSPHRASE - - GPG_PRIVATE_KEY volumes: - ~/.ssh:/root/.ssh - ~/.m2:/root/.m2 - ~/local-staging:/root/local-staging - ..:/code - command: /bin/bash -cl "cat <(echo -e \"${GPG_PRIVATE_KEY}\") | gpg --batch --import && ./mvnw -B -Pci,linux-aarch64 -pl transport-native-unix-common,transport-native-epoll -am clean javadoc:jar package gpg:sign org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DnexusUrl=https://oss.sonatype.org -DserverId=sonatype-nexus-staging -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true -Dgpg.passphrase=${GPG_PASSPHRASE} -Dgpg.keyname=${GPG_KEYNAME}" + command: /bin/bash -cl "cat <(echo -e \"${GPG_PRIVATE_KEY}\") | gpg --batch --import && ./mvnw -B -Plinux-aarch64 -pl transport-native-unix-common,transport-native-epoll -am clean javadoc:jar package gpg:sign org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DnexusUrl=https://oss.sonatype.org -DserverId=sonatype-nexus-staging -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true -Dgpg.passphrase=${GPG_PASSPHRASE} -Dgpg.keyname=${GPG_KEYNAME}" cross-compile-aarch64-shell: <<: *cross-compile-aarch64-common @@ -55,4 +56,4 @@ services: cross-compile-aarch64-build: <<: *cross-compile-aarch64-common - command: /bin/bash -cl "./mvnw -Pci,linux-aarch64 -pl transport-native-unix-common,transport-native-epoll -am clean package -DskipTests=true" \ No newline at end of file + command: /bin/bash -cl "./mvnw -Plinux-aarch64 -pl transport-native-unix-common,transport-native-epoll -am clean package -DskipTests=true" \ No newline at end of file diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 80a5d26cce..3e83fefec2 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -11,6 +11,11 @@ services: common: &common image: netty:default depends_on: [runtime-setup] + environment: + - GPG_KEYNAME + - GPG_PASSPHRASE + - GPG_PRIVATE_KEY + - MAVEN_OPTS volumes: - ~/.ssh:/root/.ssh - ~/.gnupg:/root/.gnupg @@ -42,10 +47,6 @@ services: stage-release: <<: *common - environment: - - GPG_KEYNAME - - GPG_PASSPHRASE - - GPG_PRIVATE_KEY volumes: - ~/.ssh:/root/.ssh - ~/.m2:/root/.m2 diff --git a/pom.xml b/pom.xml index 64443db55d..a8150bc0cf 100644 --- a/pom.xml +++ b/pom.xml @@ -68,14 +68,6 @@ - - ci - - false - false - 120 - - graal