Skip to content

Commit

Permalink
Refactor quick profile (#1190)
Browse files Browse the repository at this point in the history
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](mojohaus/license-maven-plugin@e0d528b)
- 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
  • Loading branch information
JackPGreen authored and actions-user committed Mar 26, 2024
1 parent d122cb8 commit 38f762f
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 43 deletions.
14 changes: 1 addition & 13 deletions .github/workflows/azure-terraform-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 1 addition & 14 deletions .github/workflows/build-artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 1 addition & 13 deletions .github/workflows/gcp-terraform-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 14 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1585,10 +1585,24 @@
</property>
</activation>
<properties>
<!-- https://maven.apache.org/plugins/maven-checkstyle-plugin/checkstyle-mojo.html#skip -->
<checkstyle.skip>true</checkstyle.skip>
<!-- https://www.mojohaus.org/xml-maven-plugin/validate-mojo.html#skip -->
<xml.skip>true</xml.skip>
<!-- https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#skipTests -->
<skipTests>true</skipTests>
<!-- https://maven.apache.org/plugins/maven-javadoc-plugin/javadoc-mojo.html#skip -->
<maven.javadoc.skip>true</maven.javadoc.skip>
<!-- https://maven.apache.org/plugins/maven-source-plugin/jar-mojo.html#skipSource -->
<maven.source.skip>true</maven.source.skip>
<!-- https://maven.apache.org/enforcer/maven-enforcer-plugin/enforce-mojo.html#skip -->
<enforcer.skip>true</enforcer.skip>
<!-- https://github.com/hazelcast/attribution-maven-plugin?tab=readme-ov-file#configuration-properties -->
<attribution.skip>true</attribution.skip>
<!-- https://www.mojohaus.org/license-maven-plugin/add-third-party-mojo.html#skipAddThirdParty -->
<license.skipAddThirdParty>true</license.skipAddThirdParty>
<!-- https://www.mojohaus.org/license-maven-plugin/aggregate-add-third-party-mojo.html -->
<license.skipAggregateAddThirdParty>true</license.skipAggregateAddThirdParty>
</properties>
</profile>
<profile>
Expand Down

0 comments on commit 38f762f

Please sign in to comment.