From 60c095b8b369f0072f627ecbc38de2f8607b9fac Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Mon, 7 Jun 2021 14:33:19 +0200 Subject: [PATCH] Make build log output less chatty (#300) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Motivation: When Maven does not run in batch mode, it will continuously print its progress as it downloads dependencies. This can produce a very large amount of log output, that makes it harder to debug build failures. Modification: - Make all Maven builds run in batch mode by adding the -B command line flag. - Some builds were already running batch mode but had the flag in a different location – these have had their -B flag moved so all builds are consistent. - Add -ntp flag Result: Much less output in our build logs where Maven is just downloading stuff. --- .github/workflows/ci-build.yml | 2 +- .github/workflows/ci-deploy.yml | 4 ++-- .github/workflows/ci-pr.yml | 2 +- .github/workflows/ci-release.yml | 8 ++++---- docker/docker-compose.centos-6.yaml | 14 +++++++------- docker/docker-compose.centos-7.yaml | 10 +++++----- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 6aea2530b..f2c0ac5ed 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -145,7 +145,7 @@ jobs: windows-x86_64-maven-cache- - name: Build project - run: ./mvnw.cmd --file pom.xml clean package + run: ./mvnw.cmd -B -ntp --file pom.xml clean package - uses: actions/upload-artifact@v2 if: ${{ failure() }} diff --git a/.github/workflows/ci-deploy.yml b/.github/workflows/ci-deploy.yml index c838b0a74..c9722cf8d 100644 --- a/.github/workflows/ci-deploy.yml +++ b/.github/workflows/ci-deploy.yml @@ -142,7 +142,7 @@ jobs: }] - name: Stage snapshots to local staging directory - run: ./mvnw.cmd --file pom.xml clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DaltStagingDirectory=local-staging -DskipRemoteStaging=true -DskipTests=true + run: ./mvnw.cmd -B -ntp --file pom.xml clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DaltStagingDirectory=local-staging -DskipRemoteStaging=true -DskipTests=true - name: Upload local staging directory uses: actions/upload-artifact@v2 @@ -209,4 +209,4 @@ jobs: }] - name: Deploy local staged artifacts - run: ./mvnw -B --file pom.xml org.sonatype.plugins:nexus-staging-maven-plugin:deploy-staged -DaltStagingDirectory=$LOCAL_STAGING_DIR + run: ./mvnw -B -ntp --file pom.xml org.sonatype.plugins:nexus-staging-maven-plugin:deploy-staged -DaltStagingDirectory=$LOCAL_STAGING_DIR diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index 4f8ee1b7b..dee768426 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -154,7 +154,7 @@ jobs: pr-windows-x86_64-maven-cache- - name: Build project - run: ./mvnw.cmd --file pom.xml clean package + run: ./mvnw.cmd -B -ntp --file pom.xml clean package - name: Upload Test Results if: always() diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml index f39bdce6d..944138fbb 100644 --- a/.github/workflows/ci-release.yml +++ b/.github/workflows/ci-release.yml @@ -56,8 +56,8 @@ jobs: - name: Prepare release with Maven run: | - ./mvnw -DpreparationGoals=clean release:prepare -B --file pom.xml -DskipTests=true - ./mvnw clean + ./mvnw -B -ntp --file pom.xml -DskipTests=true -DpreparationGoals=clean release:prepare + ./mvnw -B -ntp clean - name: Checkout tag run: ./.github/scripts/release_checkout_tag.sh release.properties @@ -242,7 +242,7 @@ jobs: - name: Stage release to local staging directory working-directory: prepare-release-workspace - run: ./mvnw.cmd --file pom.xml clean javadoc:jar package gpg:sign org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DnexusUrl=https://oss.sonatype.org -DserverId=sonatype-nexus-staging -DaltStagingDirectory=local-staging -DskipRemoteStaging=true -DskipTests=true -D'checkstyle.skip=true' + run: ./mvnw.cmd -B -ntp --file pom.xml clean javadoc:jar package gpg:sign org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DnexusUrl=https://oss.sonatype.org -DserverId=sonatype-nexus-staging -DaltStagingDirectory=local-staging -DskipRemoteStaging=true -DskipTests=true -D'checkstyle.skip=true' - name: Upload local staging directory uses: actions/upload-artifact@v2 @@ -333,7 +333,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: ./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 + run: ./mvnw -B -ntp --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/docker/docker-compose.centos-6.yaml b/docker/docker-compose.centos-6.yaml index 73e913036..d0c9cffbf 100644 --- a/docker/docker-compose.centos-6.yaml +++ b/docker/docker-compose.centos-6.yaml @@ -25,19 +25,19 @@ services: build: <<: *common - command: /bin/bash -cl "./mvnw clean package" + command: /bin/bash -cl "./mvnw -B -ntp clean package" build-leak: <<: *common - command: /bin/bash -cl "./mvnw -Pleak clean package" + command: /bin/bash -cl "./mvnw -B -ntp -Pleak clean package" build-clean: <<: *common - command: /bin/bash -cl "./mvnw clean package" + command: /bin/bash -cl "./mvnw -B -ntp clean package" deploy: <<: *common - command: /bin/bash -cl "./mvnw clean deploy -DskipTests=true" + command: /bin/bash -cl "./mvnw -B -ntp clean deploy -DskipTests=true" volumes: - ~/.ssh:/root/.ssh - ~/.gnupg:/root/.gnupg @@ -47,7 +47,7 @@ services: deploy-clean: <<: *common - command: /bin/bash -cl "./mvnw clean deploy -DskipTests=true" + command: /bin/bash -cl "./mvnw -B -ntp clean deploy -DskipTests=true" volumes: - ~/.ssh:/root/.ssh - ~/.gnupg:/root/.gnupg @@ -64,7 +64,7 @@ services: - ~/.m2/repository:/root/.m2/repository - ~/local-staging:/root/local-staging - ..:/code - command: /bin/bash -cl "./mvnw clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true" + command: /bin/bash -cl "./mvnw -B -ntp clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true" stage-release: <<: *common @@ -74,7 +74,7 @@ services: - ~/.m2/repository:/root/.m2/repository - ~/local-staging:/root/local-staging - ..:/code - command: /bin/bash -cl "cat <(echo -e \"${GPG_PRIVATE_KEY}\") | gpg --batch --import && ./mvnw -B 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 -ntp 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}" shell: <<: *common diff --git a/docker/docker-compose.centos-7.yaml b/docker/docker-compose.centos-7.yaml index efb99466b..e52b0d1e7 100644 --- a/docker/docker-compose.centos-7.yaml +++ b/docker/docker-compose.centos-7.yaml @@ -38,7 +38,7 @@ services: cross-compile-aarch64-build: <<: *cross-compile-aarch64-common - command: /bin/bash -cl "./mvnw clean package -Plinux-aarch64 -DskipTests" + command: /bin/bash -cl "./mvnw -B -ntp clean package -Plinux-aarch64 -DskipTests" cross-compile-aarch64-deploy: <<: *cross-compile-aarch64-common @@ -47,7 +47,7 @@ services: - ~/.gnupg:/root/.gnupg - ~/.m2/repository:/root/.m2/repository - ~/.m2/settings.xml:/root/.m2/settings.xml - command: /bin/bash -cl "./mvnw clean deploy -Plinux-aarch64 -DskipTests" + command: /bin/bash -cl "./mvnw -B -ntp clean deploy -Plinux-aarch64 -DskipTests" cross-compile-aarch64-stage-snapshot: <<: *cross-compile-aarch64-common @@ -58,7 +58,7 @@ services: - ~/.m2/settings.xml:/root/.m2/settings.xml - ~/local-staging:/root/local-staging - ..:/code - command: /bin/bash -cl "./mvnw -Plinux-aarch64 clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true" + command: /bin/bash -cl "./mvnw -B -ntp -Plinux-aarch64 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 @@ -68,7 +68,7 @@ services: - ~/.m2/repository:/root/.m2/repository - ~/local-staging:/root/local-staging - ..:/code - command: /bin/bash -cl "cat <(echo -e \"${GPG_PRIVATE_KEY}\") | gpg --batch --import && ./mvnw -Plinux-aarch64 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 -ntp -Plinux-aarch64 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-install: <<: *cross-compile-aarch64-common @@ -77,4 +77,4 @@ services: - ~/.gnupg:/root/.gnupg - ~/.m2:/root/.m2 - ..:/code - command: /bin/bash -cl "./mvnw clean install -Plinux-aarch64 -DskipTests=true" + command: /bin/bash -cl "./mvnw -B -ntp clean install -Plinux-aarch64 -DskipTests=true"