From d6af9e0c675a98ec13f53d9f419df491d499d42d Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Tue, 5 Nov 2024 17:45:03 +0100 Subject: [PATCH] Add some useful workflow tips to CONTRIBUTING.md --- CONTRIBUTING.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7a3c31e0d6ad9..ded62b493b0c4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -409,6 +409,52 @@ Thus, it is recommended to use the following approach: Due to Quarkus being a large repository, having to rebuild the entire project every time a change is made isn't very productive. The following Maven tips can vastly speed up development when working on a specific extension. +#### Using mvnd + +[mvnd](https://github.com/apache/maven-mvnd) is a daemon for Maven providing faster builds. +It parallelizes your builds by default and makes sure the output is consistent even for a parallelized build. + +You can https://github.com/apache/maven-mvnd?tab=readme-ov-file#how-to-install-mvnd[install mvnd] with SDKMAN!, Homebrew... + +mvnd is a good companion for your Quarkus builds. + +Make sure you install mvnd 1.0 which embeds Maven 3.x as Quarkus does not support Maven 4 yet. +Once it is installed, you can use `mvnd` in your Maven command lines instead of the typical `mvn` or `./mvnw`. + +If anything goes wrong, you can stop the daemon and start fresh with `mvnd --stop`. + +#### Using aliases + +While building with `-Dquickly` or `-DquicklyDocs` is practical when contributing your first patches, +if you contribute to Quarkus often, it is recommended to have your own aliases - for instance to make sure your build is parallelized. + +Here are a couple of useful aliases that are good starting points - and that you will need to adapt to your environment: + +- `build-fast`: build the Quarkus artifacts and install them +- `build-docs`: run from the root of the project, build the documentation +- `format`: format the source code following our coding conventions +- `qss`: run the Quarkus CLI from a snapshot (make sure you build the artifacts first) + +- If using mvnd + +```sh +alias build-fast="mvnd -e -DskipDocs -DskipTests -DskipITs -Dinvoker.skip -DskipExtensionValidation -Dskip.gradle.tests -Dtruststore.skip clean install" +alias build-docs="mvnd -e -DskipTests -DskipITs -Dinvoker.skip -DskipExtensionValidation -Dskip.gradle.tests -Dskip.gradle.tests -Dtruststore.skip -Dno-test-modules -Dasciidoctor.fail-if=DEBUG clean install" +alias format="mvnd process-sources -Denforcer.skip -Dprotoc.skip" +alias qss="java -jar ${HOME}/git/quarkus/devtools/cli/target/quarkus-cli-999-SNAPSHOT-runner.jar" +``` + +- If using plain Maven + +```sh +alias build-fast="mvn -T0.8C -e -DskipDocs -DskipTests -DskipITs -Dinvoker.skip -DskipExtensionValidation -Dskip.gradle.tests -Dtruststore.skip clean install" +alias build-docs="mvnd -T0.8C -e -DskipTests -DskipITs -Dinvoker.skip -DskipExtensionValidation -Dskip.gradle.tests -Dskip.gradle.tests -Dtruststore.skip -Dno-test-modules -Dasciidoctor.fail-if=DEBUG clean install" +alias format="mvnd -T0.8C process-sources -Denforcer.skip -Dprotoc.skip" +alias qss="java -jar ${HOME}/git/quarkus/devtools/cli/target/quarkus-cli-999-SNAPSHOT-runner.jar" +``` + +Using `./mvnw` is often not practical in this case as you might want to call these aliases from a nested directory. + #### Building all modules of an extension Let's say you want to make changes to the `Jackson` extension. This extension contains the `deployment`, `runtime`