Skip to content

Commit

Permalink
Add some useful workflow tips to CONTRIBUTING.md
Browse files Browse the repository at this point in the history
  • Loading branch information
gsmet committed Nov 5, 2024
1 parent e1fda94 commit d6af9e0
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down

0 comments on commit d6af9e0

Please sign in to comment.