-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not run the Gradle tests when using -DquicklyDocs and add some useful workflow tips #44329
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -409,6 +409,53 @@ 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 the latest mvnd 1.0.x 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 -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="mvn -T0.8C -e -DskipTests -DskipITs -Dinvoker.skip -DskipExtensionValidation -Dskip.gradle.tests -Dtruststore.skip -Dno-test-modules -Dasciidoctor.fail-if=DEBUG clean install" | ||
alias format="mvn -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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tend to use gum for solving that issue. https://andresalmiray.com/gum-the-gradle-maven-wrapper/ then have alias mvn=gm which then locates ./mvnw if in root. |
||
[gum](https://andresalmiray.com/gum-the-gradle-maven-wrapper/) might be useful in this case. | ||
|
||
#### Building all modules of an extension | ||
|
||
Let's say you want to make changes to the `Jackson` extension. This extension contains the `deployment`, `runtime` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
skipDocs
,skipTests
,skipITs
,skipExtensionValidation
invoker.skip
,truststore.skip
skip.gradle.tests
Yup, we got all three naming conventions, can't think of any other :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conventions are not ours. They are coming from the Maven plugins we are using (except
skip.gradle.tests
which is indeed not ideal).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figured :(