Este contenido no está disponible en el idioma seleccionado.

7.3. Configuring Maven to Use File System Repositories


Overview

In situations where you cannot use the online repositories, you will have to download and configure the required repositories locally.

  1. Download the following ZIP archives containing the required repositories:

  2. Unzip the downloaded ZIP files into an arbitrary location in a local file system.
  3. Add entries for the unzipped repositories to Maven’s settings.xml file. The following code sample contains a profile with the repositories, configuration of authentication for access to the repositories, and an activation entry for the profile:

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://maven.apache.org/xsd/settings-1.0.0.xsd">
      <localRepository/>
      <profiles>
      <!-- Profile with local repositories required by
           Red Hat JBoss BRMS/Red Hat JBoss BPM Suite -->
        <profile>
          <id>brms-bpms-local-profile</id>
          <repositories>
            <repository>
              <id>jboss-brms-bpmsuite-repository</id>
              <name>BRMS/BPMS 6.3.0 GA Repository</name>
              <url>
                file://<!-- path to the repository -->
                      /jboss-brms-bpmsuite-6.3.0.GA-maven-repository/maven-repository
              </url>
              <layout>default</layout>
              <releases>
                <enabled>true</enabled>
                <updatePolicy>never</updatePolicy>
              </releases>
              <snapshots>
                <enabled>false</enabled>
                <updatePolicy>never</updatePolicy>
              </snapshots>
            </repository>
          </repositories>
          <pluginRepositories>
            <pluginRepository>
              <id>jboss-brms-bpmsuite-repository</id>
              <name>BRMS/BPMS 6.3.0 GA Repository</name>
              <url>
                file://<!-- path to the repository -->
                      /jboss-brms-bpmsuite-6.3.0.GA-maven-repository/maven-repository
              </url>
              <layout>default</layout>
              <releases>
                <enabled>true</enabled>
                <updatePolicy>never</updatePolicy>
              </releases>
              <snapshots>
                <enabled>false</enabled>
                <updatePolicy>never</updatePolicy>
              </snapshots>
            </pluginRepository>
          </pluginRepositories>
        </profile>
      </profiles>
    
      <servers>
        <!-- Configuring pre-emptive authentication for the repository server -->
        <server>
          <id>brms-bpms-m2-repo</id>
          <username>admin</username>
          <password>admin</password>
          <configuration>
            <wagonProvider>httpclient</wagonProvider>
            <httpConfiguration>
              <all>
                <usePreemptive>true</usePreemptive>
              </all>
            </httpConfiguration>
          </configuration>
        </server>
    
        <!-- Alternative to enabling pre-emptive authentication - configuring
             the Authorization HTTP header with Base64-encoded credentials
        <server>
          <id>brms-bpms-m2-repo</id>
          <configuration>
            <httpHeaders>
              <property>
                <name>Authorization</name>
                <value>Basic YWRtaW46YWRtaW4=</value>
              </property>
            </httpHeaders>
          </configuration>
        </server>
        -->
      </servers>
    
      <activeProfiles>
        <!-- Activation of the Red Hat JBoss BRMS/Red Hat JBoss BPM Suite profile -->
        <activeProfile>brms-bpms-local-profile</activeProfile>
      </activeProfiles>
    </settings>

Result

The Maven repositories are downloaded, unzipped in a local file system, registered in Maven’s settings.xml file, and ready to be used when performing Maven builds.

7.3.1. Troubleshooting

When you build or deploy a project, it fails with one or both of the following errors:

  • [ERROR] Failed to execute goal on project PROJECT_NAME
  • Could not find artifact ARTIFACT_NAME

Your cached local Maven repository might contain outdated artifacts.

To resolve the issue, delete the cached local repository — the ~/.m2/repository/ directory on Linux or the %SystemDrive%\Users\USERNAME\.m2\repository\ directory on Windows — and run mvn clean install -U. This will force Maven to download correct versions of required artifacts when performing the next build.

You have updated your Maven configuration, but this configuration is not reflected in Red Hat JBoss Developer Studio.

If Red Hat JBoss Developer Studio is running when you modify your Maven settings.xml file, this configuration will not be reflected in Red Hat JBoss Developer Studio.

Refresh the Maven settings in the IDE. From the menu, choose Window Preferences. In the Preferences window, expand Maven and choose User Settings. Click the Update Settings button to refresh the Maven user settings in Red Hat JBoss Developer Studio.

Updating Maven Settings
Red Hat logoGithubredditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

Theme

© 2026 Red Hat
Volver arriba