Skip to content

Commit

Permalink
Make build log output less chatty (java-native-access#300)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
normanmaurer committed Jun 7, 2021
1 parent 69fdc1c commit 60c095b
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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() }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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/
Expand Down
14 changes: 7 additions & 7 deletions docker/docker-compose.centos-6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions docker/docker-compose.centos-7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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"

0 comments on commit 60c095b

Please sign in to comment.