From 38f762f7f48d9d180f78923741f781c246e2eee3 Mon Sep 17 00:00:00 2001 From: Jack Green Date: Tue, 26 Mar 2024 08:55:13 +0000 Subject: [PATCH] Refactor `quick` profile (#1190) The `quick` Maven profile is designed to skip some _optional_ checks that are not required for local builds. Some of the GitHub actions use their own equivalent of `quick` where _similar_ checks are skipped. This leads to some [cryptic combination of options being used](https://github.com/hazelcast/hazelcast-mono/pull/1181#discussion_r1537113981). I think it makes sense for a common `quick` configuration to be used so that if someone adds a new _optional_ validation (e.g. https://github.com/hazelcast/hazelcast-mono/pull/342), existing build configurations can handle this automatically. Changes: - Migrated all related `.skip` options to the `quick` profile - Reconfigured those jobs to use the `quick` profile instead - Documented what the `.skip` is actually skipping (i.e. a link to the documentation) - Replaced `license.skip` with the new variant(s) as [this option was removed over ten years ago](https://github.com/mojohaus/license-maven-plugin/commit/e0d528b8a3b226f69013926c188739eed9ba3675) - Added a `skip` for the `xml-maven-plugin` which is similar to checkstyle but [was only recently added](https://github.com/hazelcast/hazelcast-mono/pull/342) - removed options for since-removed plugins (e.g. findbugs) Checklist: - [ ] Go through Jenkins jobs and see if they can be simplified as well Relates to [HZ-4620](https://hazelcast.atlassian.net/browse/HZ-4620) [HZ-4620]: https://hazelcast.atlassian.net/browse/HZ-4620?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ GitOrigin-RevId: 8108165d24654a62e515bb48f04c70873b51128d --- .../azure-terraform-integration-tests.yml | 14 +------------- .github/workflows/build-artifact.yml | 15 +-------------- .github/workflows/codeql-analysis.yml | 2 +- .../workflows/gcp-terraform-integration-tests.yml | 14 +------------- README.md | 5 +++-- pom.xml | 14 ++++++++++++++ 6 files changed, 21 insertions(+), 43 deletions(-) diff --git a/.github/workflows/azure-terraform-integration-tests.yml b/.github/workflows/azure-terraform-integration-tests.yml index 46ca61b82d988..2030c62ab0b82 100644 --- a/.github/workflows/azure-terraform-integration-tests.yml +++ b/.github/workflows/azure-terraform-integration-tests.yml @@ -60,19 +60,7 @@ jobs: - name: Build hazelcast jar run: | - ./mvnw -T 4 -B -V -e clean package \ - -Dfindbugs.skip \ - -Dcheckstyle.skip \ - -Dpmd.skip=true \ - -Dspotbugs.skip \ - -Denforcer.skip \ - -Dmaven.javadoc.skip \ - -DskipTests \ - -Dlicense.skip=true \ - -Drat.skip=true \ - -Dspotless.check.skip=true \ - -Dattribution.skip \ - -Dmaven.source.skip=true + ./mvnw -T 4 -B -V -e clean package --activate-profiles quick \ echo "Hazelcast jar is: " hazelcast/target/hazelcast-*-SNAPSHOT.jar cp hazelcast/target/hazelcast-*-SNAPSHOT.jar ~/hazelcast.jar diff --git a/.github/workflows/build-artifact.yml b/.github/workflows/build-artifact.yml index be175759a8794..df5dfb56eec9d 100644 --- a/.github/workflows/build-artifact.yml +++ b/.github/workflows/build-artifact.yml @@ -89,20 +89,7 @@ jobs: run: | HAZELCAST_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) echo "HAZELCAST_VERSION=${HAZELCAST_VERSION}" >> $GITHUB_ENV - ./mvnw -T 4 -B -V -e clean install \ - -Dfindbugs.skip \ - -Dcheckstyle.skip \ - -Dpmd.skip=true \ - -Dspotbugs.skip \ - -Denforcer.skip \ - -Dmaven.javadoc.skip \ - -DskipTests \ - -Dlicense.skip=true \ - -Drat.skip=true \ - -Dspotless.check.skip=true \ - -Dattribution.skip \ - -Danimal.sniffer.skip=true \ - -Dmaven.source.skip=true + ./mvnw -T 4 -B -V -e clean install --activate-profiles quick \ cp hazelcast/target/hazelcast-*-SNAPSHOT.jar ${GITHUB_WORKSPACE}/aws-discovery-suite/terraform/tools/hazelcast.jar - name: Build client jar diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index b2d0eeb1f5d08..744cf163b6dda 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -58,7 +58,7 @@ jobs: - name: Custom Java build run: | - ./mvnw -B -V -e clean package -Dfindbugs.skip -Dcheckstyle.skip -Dpmd.skip=true -Dspotbugs.skip -Denforcer.skip -Dmaven.javadoc.skip -DskipTests -Dlicense.skip=true -Drat.skip=true -Dspotless.check.skip=true -Dattribution.skip -Dmaven.source.skip=true + ./mvnw -B -V -e clean package --activate-profiles quick - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/gcp-terraform-integration-tests.yml b/.github/workflows/gcp-terraform-integration-tests.yml index 5fe2b031645da..559841be9cb1b 100644 --- a/.github/workflows/gcp-terraform-integration-tests.yml +++ b/.github/workflows/gcp-terraform-integration-tests.yml @@ -60,19 +60,7 @@ jobs: - name: Build hazelcast jar run: | - ./mvnw -T 4 -B -V -e clean package \ - -Dfindbugs.skip \ - -Dcheckstyle.skip \ - -Dpmd.skip=true \ - -Dspotbugs.skip \ - -Denforcer.skip \ - -Dmaven.javadoc.skip \ - -DskipTests \ - -Dlicense.skip=true \ - -Drat.skip=true \ - -Dspotless.check.skip=true \ - -Dattribution.skip \ - -Dmaven.source.skip=true + ./mvnw -T 4 -B -V -e clean package --activate-profiles quick \ echo "Hazelcast jar is: " hazelcast/target/hazelcast-*-SNAPSHOT.jar cp hazelcast/target/hazelcast-*-SNAPSHOT.jar ~/hazelcast.jar diff --git a/README.md b/README.md index 56c247d741519..7f5c084e52c42 100755 --- a/README.md +++ b/README.md @@ -306,8 +306,9 @@ It is also possible to use local Maven distribution with the same version that is used in the Maven wrapper script. Additionally, there is a `quick` build activated by setting the `-Dquick` system -property that skips tests, checkstyle validation, javadoc and source plugins and -does not build `extensions` and `distribution` modules. +property that skips validation tasks for faster local builds (e.g. tests, checkstyle +validation, javadoc, source plugins etc) and does not build `extensions` and `distribution` +modules. ### Testing diff --git a/pom.xml b/pom.xml index 8e50350257725..52242ee726b94 100644 --- a/pom.xml +++ b/pom.xml @@ -1585,10 +1585,24 @@ + true + + true + true + true + true + + true + + true + + true + + true