diff --git a/.ci/build-pr.sh b/.ci/build-pr.sh index f90221d9dc..084974bd05 100755 --- a/.ci/build-pr.sh +++ b/.ci/build-pr.sh @@ -3,13 +3,14 @@ source $(dirname $0)/inc/logger.inc source $(dirname $0)/inc/setup-secrets.inc source $(dirname $0)/inc/regression-tester.inc +source $(dirname $0)/inc/maven-dependencies.inc source ${HOME}/java.env set -e #set -x -export MAVEN_OPTS="-Dmaven.wagon.httpconnectionManager.ttlSeconds=180 -Dmaven.wagon.http.retryHandler.count=3" -#export MAVEN_OPTS="-Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false" +maven_dependencies_resolve + ./mvnw -e -V clean verify # Danger is executed only on the linux runner diff --git a/.ci/inc/maven-dependencies.inc b/.ci/inc/maven-dependencies.inc new file mode 100644 index 0000000000..2c48bc39a4 --- /dev/null +++ b/.ci/inc/maven-dependencies.inc @@ -0,0 +1,25 @@ + +# +# On azure, outgoing idle connection are dropped after 4 minutes. +# Usually, you can configure wagon with ttl. But these settings are +# ignored, as soon as dokka-maven-plugin is loaded. +# dokka-maven-plugin tries to load additional dependencies at runtime +# and injects a different http client, which is not configured correctly +# and thus maven fails if it tries to download later in the build process +# further dependencies. +# +# The workaround applied here is: first resolve all dependencies, +# then explicitly get dokka-maven-plugin and then resolve all plugins +# execpt for dokka-maven-plugin, as it does not play well with dependency-plugin. +# +function maven_dependencies_resolve() { + dokka_version=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${dokka.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:3.0.0:exec) + + ./mvnw dependency:resolve + ./mvnw dependency:get -DgroupId=org.jetbrains.dokka \ + -DartifactId=dokka-maven-plugin \ + -Dversion=${dokka_version} \ + -Dpackaging=jar \ + -DremoteRepositories=jcenter::default::https://jcenter.bintray.com/ + ./mvnw dependency:resolve-plugins -DexcludeGroupIds=org.jetbrains.dokka +} diff --git a/.github/workflows/pull-requests.yml b/.github/workflows/pull-requests.yml index 764eebb453..e278d7ba3a 100644 --- a/.github/workflows/pull-requests.yml +++ b/.github/workflows/pull-requests.yml @@ -7,6 +7,7 @@ jobs: build: runs-on: ${{ matrix.os }} continue-on-error: false + timeout-minutes: 30 if: "!contains(github.event.head_commit.message, '[skip ci]')" strategy: matrix: @@ -34,6 +35,7 @@ jobs: run: .ci/build-pr.sh shell: bash env: + MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=180 -Dmaven.wagon.http.retryHandler.count=3 PMD_CI_SECRET_PASSPHRASE: ${{ secrets.PMD_CI_SECRET_PASSPHRASE }} PMD_CI_BRANCH: ${{ github.ref }} PMD_CI_PULL_REQUEST_NUMBER: ${{ github.event.number }} diff --git a/.github/workflows/troubleshooting.yml b/.github/workflows/troubleshooting.yml index 7a4af43a7c..dcdeeb9338 100644 --- a/.github/workflows/troubleshooting.yml +++ b/.github/workflows/troubleshooting.yml @@ -1,12 +1,11 @@ name: troubleshooting -on: pull_request +on: workflow_dispatch jobs: build: runs-on: ${{ matrix.os }} continue-on-error: false - if: "!contains(github.event.head_commit.message, '[skip ci]')" strategy: matrix: #os: [ ubuntu-latest, windows-latest, macos-latest ]