How to configure JBoss Maven Repository

This article provides a concise overview of the JBoss and Red Hat repositories, essential tools for building enterprise applications with Maven. By understanding these repositories and their contents, you can easily incorporate JBoss and Red Hat components into your Maven-based projects.

Configuring the JBoss Maven repository is a relatively simple process that can greatly improve the development experience for projects that use Maven as their build tool. Here’s a step-by-step guide to configuring the JBoss Maven repository:

  1. Download and install Maven: The first step is to ensure that you have Maven installed on your machine. If you don’t already have Maven, you can download it from the Maven website (https://maven.apache.org/download.cgi) and follow the installation instructions.
  2. Set up the JBoss Maven repository: To set up the JBoss Maven repository, you will need to add one of the following repositories:

Please note that artifacts in these repositories do not receive automated security patches. This is because Maven requires that artifacts are immutable to avoid breaking builds that depend on them. Patched artifacts, on the other hand, have their version number incremented.

Here is a sample repository section you can include in your pom.xml file:

<repositories>
        <repository>
            <id>jboss-public-maven-repository</id>
            <name>JBoss Public Maven Repository</name>
            <url>https://repository.jboss.org/nexus/content/groups/public/</url>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>never</updatePolicy>
            </releases>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>never</updatePolicy>
            </snapshots>
            <layout>default</layout>
        </repository>
        <repository>
            <id>redhat-ga-maven-repository</id>
            <name>Red Hat GA Maven Repository</name>
            <url>https://maven.repository.redhat.com/ga/</url>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>never</updatePolicy>
            </releases>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>never</updatePolicy>
            </snapshots>
            <layout>default</layout>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>jboss-public-maven-repository</id>
            <name>JBoss Public Maven Repository</name>
            <url>https://repository.jboss.org/nexus/content/groups/public/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>redhat-ga-maven-repository</id>
            <name>Red Hat GA Maven Repository</name>
            <url>https://maven.repository.redhat.com/ga/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

Finally, to set up the JBoss Maven repository as default for your Maven projects, you can add it into the settings.xml file, which is available in the conf directory of your Maven installation.

If you want a read-to-go settings.xml file, then you can grab the following one which already contains the JBoss repository configuration in it: https://github.com/fmarchioni/mastertheboss/blob/master/scripts/settings.xml

Gathering early access dependencies

The JBoss Public Maven Repository includes also early access (alpha, beta) releases for its builds. On the other hand, if you want to access early builds (Alpha, Beta) for Red Hat builds, you can use the repository https://maven.repository.redhat.com/earlyaccess/all/

Accessing Nexus Maven repository

If you have a Red Hat account and want to search for builds using a friendly console, then you can access directly Red Hat’s Nexus Maven repository which is available here: https://repository.jboss.org/nexus/

For example:

Found the article helpful? if so please follow us on Socials