Configure your environment

Red Hat build of Quarkus 3.33

Red Hat Customer Content Services

Abstract

This guide describes how to configure your environment to get started and work with Quarkus.

Chapter 1. Configure the Maven settings.xml file for the online repository

To use the Red Hat-hosted Quarkus repository with your Quarkus Maven project, configure the settings.xml file for your user. The configuration defines the Quarkus repository as a Maven profile and activates it so Maven can resolve Quarkus dependencies during builds.

Note

When you configure the repository by modifying the Maven settings.xml file, the changes apply to all of your Maven projects. If you want to apply the configuration to a specific project only, use the -s option and specify the path to the project-specific settings.xml file.

Procedure

  1. Open the Maven $HOME/.m2/settings.xml file in a text editor or an integrated development environment (IDE).

    Note

    If no settings.xml file is present in the $HOME/.m2/ directory, copy the settings.xml file from the $MAVEN_HOME/conf/ directory into the $HOME/.m2/ directory.

  2. Add the following Maven profile, which defines the Red Hat-hosted Quarkus repository, to the <profiles> element of the settings.xml file:

    <profile>
      <id>red-hat-enterprise-maven-repository</id>
      <repositories>
        <repository>
          <id>red-hat-enterprise-maven-repository</id>
          <url>https://maven.repository.redhat.com/ga/</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>red-hat-enterprise-maven-repository</id>
          <url>https://maven.repository.redhat.com/ga/</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>

     

  3. Add the following lines to the <activeProfiles> element of the settings.xml file and save the file.

    <activeProfiles>
      <activeProfile>red-hat-enterprise-maven-repository</activeProfile>
    </activeProfiles>

Verification

Run mvn help:effective-settings. The output lists the Quarkus repository profile under <profiles> and shows it as active under <activeProfiles>.

Chapter 2. Configure the extension registry client

The extension registry, registry.quarkus.redhat.com, hosts the Quarkus extensions that Red Hat provides.

You can configure your Quarkus developer tools to access extensions in this registry by adding the registry to your registry client configuration file. The registry client configuration file is a YAML file that contains a list of registries.

Note
  • The default Quarkus registry is registry.quarkus.io; typically, you do not need to configure it. However, if a user provides a custom registry list and registry.quarkus.io is not on it, then registry.quarkus.io is not enabled.
  • Ensure that the registry you prefer appears first on the registry list. When Quarkus developer tools search for registries, they begin at the top of the list.

Procedure

  1. Open the config.yaml file that contains your extension registry configuration. When you configure your extension registries for the first time, you might need to create a config.yaml file in the $HOME/.quarkus directory on your machine.
  2. Add the new registry to the config.yaml file. For example:

    config.yaml

    registries:
      - registry.quarkus.redhat.com
      - registry.quarkus.io

2.1. Limit the extension catalog to a specific offering

The extension registry, registry.quarkus.redhat.com, hosts the definition of Quarkus extensions that Red Hat provides.

Extensions can be associated with multiple offerings; however, you can configure the extension registry to limit the extension catalog to a specific offering. You can configure only one offering per registry.

In the following example, the extension catalog provided by registry.quarkus.redhat.com is limited to extensions that make up the redhat offering.

Note

If you do not configure an offering, the registry returns the complete extension catalog.

Procedure

  1. Open the config.yaml file that contains your extension registry configuration.
  2. Add offering: redhat to the config.yaml file.

    For example:

    config.yaml

    registries:
      - registry.quarkus.redhat.com
          offering: redhat
      - registry.quarkus.io

Legal Notice

Copyright © Red Hat.
Except as otherwise noted below, the text of and illustrations in this documentation are licensed by Red Hat under the Creative Commons Attribution–Share Alike 3.0 Unported license . If you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, the Red Hat logo, JBoss, Hibernate, and RHCE are trademarks or registered trademarks of Red Hat, LLC. or its subsidiaries in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
XFS is a trademark or registered trademark of Hewlett Packard Enterprise Development LP or its subsidiaries in the United States and other countries.
The OpenStack® Word Mark and OpenStack logo are trademarks or registered trademarks of the Linux Foundation, used under license.
All other trademarks are the property of their respective owners.