Chapter 7. Installing and managing Java extensions with Quarkus applications
You can use Java extensions to expand the functionality of your application and to configure, boot, and integrate a framework into your application. This procedure shows you how to find and add extensions to your Quarkus project.
Prerequisites
- You have a Quarkus Maven project.
Procedure
- Navigate to your Quarkus project directory.
To list the available extensions, enter the following command:
./mvnw quarkus:list-extensions
./mvnw quarkus:list-extensionsCopy to Clipboard Copied! Toggle word wrap Toggle overflow To add an extension to your project, enter the following command where
<extension>is the group, artifact, version (GAV) of the extension that you want to add:./mvnw quarkus:add-extension -Dextensions="<extension>"
./mvnw quarkus:add-extension -Dextensions="<extension>"Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example, to add the Agroal extension, enter the following command:
./mvnw quarkus:add-extension -Dextensions="io.quarkus:quarkus-agroal"
./mvnw quarkus:add-extension -Dextensions="io.quarkus:quarkus-agroal"Copy to Clipboard Copied! Toggle word wrap Toggle overflow To search for a specific extension, enter the extension name or partial name after
-Dextensions=. The following example searches for extensions that contain the textjdbc,agroal, andnon-exist-entin the name:./mvnw quarkus:add-extension -Dextensions=jdbc,agroal,non-exist-ent
./mvnw quarkus:add-extension -Dextensions=jdbc,agroal,non-exist-entCopy to Clipboard Copied! Toggle word wrap Toggle overflow This command returns the following result:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To install all extensions that a specific text string returns, enter the extension name or partial name after
-Dextensions=. The following example searches for and installs all extensions that begin withhibernate-:./mvnw quarkus:add-extension -Dextensions="hibernate-*"
./mvnw quarkus:add-extension -Dextensions="hibernate-*"Copy to Clipboard Copied! Toggle word wrap Toggle overflow