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
This commit is contained in:
Norman Maurer 2021-05-12 18:02:35 +02:00 committed by GitHub
parent d0b7f76b9b
commit c443bc40fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 44 additions and 37 deletions

View File

@ -10,5 +10,5 @@ TAG=$(grep scm.tag= "$1" | cut -d'=' -f2)
git remote set-url origin git@github.com:"$2".git git remote set-url origin git@github.com:"$2".git
git fetch git fetch
git checkout "$3" git checkout "$3"
mvn -B --file pom.xml release:rollback ./mvnw -B --file pom.xml release:rollback
git push origin :"$TAG" git push origin :"$TAG"

View File

@ -10,6 +10,9 @@ on:
# Allows you to run this workflow manually from the Actions tab # Allows you to run this workflow manually from the Actions tab
workflow_dispatch: 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: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -10,6 +10,9 @@ on:
# Allows you to run this workflow manually from the Actions tab # Allows you to run this workflow manually from the Actions tab
workflow_dispatch: 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: jobs:
stage-snapshot: stage-snapshot:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -122,4 +125,4 @@ jobs:
}] }]
- name: Deploy local staged artifacts - 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 run: ./mvnw -B --file pom.xml org.sonatype.plugins:nexus-staging-maven-plugin:deploy-staged -DaltStagingDirectory=$LOCAL_STAGING_DIR

View File

@ -4,6 +4,9 @@ on:
workflows: [ "Build PR" ] workflows: [ "Build PR" ]
types: types:
- completed - completed
env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryhandler.count=5 -Dmaven.wagon.httpconnectionManager.ttlSeconds=240
jobs: jobs:
tests: tests:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -7,6 +7,9 @@ on:
# Allows you to run this workflow manually from the Actions tab # Allows you to run this workflow manually from the Actions tab
workflow_dispatch: 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: jobs:
verify-pr: verify-pr:
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04
@ -26,7 +29,7 @@ jobs:
${{ runner.os }}-maven-verify-pr- ${{ runner.os }}-maven-verify-pr-
${{ runner.os }}-maven- ${{ runner.os }}-maven-
- name: Verify with 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: build-pr-aarch64:
name: linux-aarch64-verify-native 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. # Use tcnative.classifier that is empty as we don't support using the shared lib version on ubuntu.
run: | 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: build-pr:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -5,6 +5,9 @@ on:
# Releases can only be triggered via the action tab # Releases can only be triggered via the action tab
workflow_dispatch: 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: jobs:
prepare-release: prepare-release:
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04
@ -41,8 +44,8 @@ jobs:
- name: Prepare release with Maven - name: Prepare release with Maven
run: | run: |
mvn -B --file pom.xml -Pci release:prepare -DpreparationGoals=clean -DskipTests=true ./mvnw -B --file pom.xml release:prepare -DpreparationGoals=clean -DskipTests=true
mvn -Pci clean ./mvnw clean
- name: Checkout tag - name: Checkout tag
run: ./.github/scripts/release_checkout_tag.sh release.properties run: ./.github/scripts/release_checkout_tag.sh release.properties
@ -161,6 +164,9 @@ jobs:
name: prepare-release-workspace name: prepare-release-workspace
path: ./prepare-release-workspace/ path: ./prepare-release-workspace/
- name: Adjust mvnw permissions
run: chmod 755 ./prepare-release-workspace/mvnw
- name: Set up JDK 8 - name: Set up JDK 8
uses: actions/setup-java@v1 uses: actions/setup-java@v1
with: with:
@ -219,7 +225,7 @@ jobs:
- name: Deploy local staged artifacts - name: Deploy local staged artifacts
working-directory: ./prepare-release-workspace/ working-directory: ./prepare-release-workspace/
# If we don't want to close the repository we can add -DskipStagingRepositoryClose=true # 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 - name: Rollback release on failure
working-directory: ./prepare-release-workspace/ working-directory: ./prepare-release-workspace/

View File

@ -14,6 +14,9 @@ on:
schedule: schedule:
- cron: '0 13 * * 3' - 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: jobs:
analyze: analyze:
name: Analyze name: Analyze
@ -73,7 +76,8 @@ jobs:
# and modify them (or add more) to build your code if your project # and modify them (or add more) to build your code if your project
# uses a compiled language # 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 - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1 uses: github/codeql-action/analyze@v1

View File

@ -1,9 +0,0 @@
<settings>
<servers>
<server>
<id>sonatype-nexus-snapshots</id>
<username>${env.SANOTYPE_USER}</username>
<password>${env.SANOTYPE_PASSWORD}</password>
</server>
</servers>
</settings>

View File

@ -15,6 +15,11 @@ services:
cross-compile-aarch64-common: &cross-compile-aarch64-common cross-compile-aarch64-common: &cross-compile-aarch64-common
depends_on: [ cross-compile-aarch64-runtime-setup ] depends_on: [ cross-compile-aarch64-runtime-setup ]
image: netty:cross_compile_aarch64 image: netty:cross_compile_aarch64
environment:
- GPG_KEYNAME
- GPG_PASSPHRASE
- GPG_PRIVATE_KEY
- MAVEN_OPTS
volumes: volumes:
- ~/.ssh:/root/.ssh - ~/.ssh:/root/.ssh
- ~/.gnupg:/root/.gnupg - ~/.gnupg:/root/.gnupg
@ -24,7 +29,7 @@ services:
cross-compile-aarch64-deploy: cross-compile-aarch64-deploy:
<<: *cross-compile-aarch64-common <<: *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-stage-snapshot:
<<: *cross-compile-aarch64-common <<: *cross-compile-aarch64-common
@ -34,20 +39,16 @@ services:
- ~/.m2:/root/.m2 - ~/.m2:/root/.m2
- ~/local-staging:/root/local-staging - ~/local-staging:/root/local-staging
- ..:/code - ..:/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-stage-release:
<<: *cross-compile-aarch64-common <<: *cross-compile-aarch64-common
environment:
- GPG_KEYNAME
- GPG_PASSPHRASE
- GPG_PRIVATE_KEY
volumes: volumes:
- ~/.ssh:/root/.ssh - ~/.ssh:/root/.ssh
- ~/.m2:/root/.m2 - ~/.m2:/root/.m2
- ~/local-staging:/root/local-staging - ~/local-staging:/root/local-staging
- ..:/code - ..:/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-shell:
<<: *cross-compile-aarch64-common <<: *cross-compile-aarch64-common
@ -55,4 +56,4 @@ services:
cross-compile-aarch64-build: cross-compile-aarch64-build:
<<: *cross-compile-aarch64-common <<: *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" command: /bin/bash -cl "./mvnw -Plinux-aarch64 -pl transport-native-unix-common,transport-native-epoll -am clean package -DskipTests=true"

View File

@ -11,6 +11,11 @@ services:
common: &common common: &common
image: netty:default image: netty:default
depends_on: [runtime-setup] depends_on: [runtime-setup]
environment:
- GPG_KEYNAME
- GPG_PASSPHRASE
- GPG_PRIVATE_KEY
- MAVEN_OPTS
volumes: volumes:
- ~/.ssh:/root/.ssh - ~/.ssh:/root/.ssh
- ~/.gnupg:/root/.gnupg - ~/.gnupg:/root/.gnupg
@ -42,10 +47,6 @@ services:
stage-release: stage-release:
<<: *common <<: *common
environment:
- GPG_KEYNAME
- GPG_PASSPHRASE
- GPG_PRIVATE_KEY
volumes: volumes:
- ~/.ssh:/root/.ssh - ~/.ssh:/root/.ssh
- ~/.m2:/root/.m2 - ~/.m2:/root/.m2

View File

@ -68,14 +68,6 @@
</developers> </developers>
<profiles> <profiles>
<profile>
<id>ci</id>
<properties>
<http.keepAlive>false</http.keepAlive>
<maven.wagon.http.pool>false</maven.wagon.http.pool>
<maven.wagon.httpconnectionManager.ttlSeconds>120</maven.wagon.httpconnectionManager.ttlSeconds>
</properties>
</profile>
<!-- Detect if we use GraalVM and if so enable the native image testsuite --> <!-- Detect if we use GraalVM and if so enable the native image testsuite -->
<profile> <profile>
<id>graal</id> <id>graal</id>