此内容没有您所选择的语言版本。

7.4. Configuring Maven to Use Online Repositories


The online repositories required for Red Hat JBoss BPM Suite applications are located at https://maven.repository.redhat.com/ga/.

It is possible to configure Maven to use online repositories using the project’s POM file, but this is not recommended.

Procedure: Configuring Maven to Use Online Repositories

  1. Add entries for the online repositories and configuration of authentication for accessing them to Maven’s settings.xml file as in the code sample below:

    <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/SETTINGS/1.0.0
                                  http://maven.apache.org/xsd/settings-1.0.0.xsd">
      <profiles>
        <!-- Profile with online repositories required by BRMS/BPMS -->
        <profile>
          <id>brms-bpms-online-profile</id>
          <repositories>
            <repository>
              <id>jboss-ga-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>jboss-ga-plugin-repository</id>
              <url>https://maven.repository.redhat.com/ga/</url>
              <releases>
                <enabled>true</enabled>
              </releases>
              <snapshots>
                <enabled>false</enabled>
              </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 BRMS/BPMS profile -->
        <activeProfile>brms-bpms-online-profile</activeProfile>
      </activeProfiles>
    
    </settings>
    Copy to Clipboard Toggle word wrap
  2. If you modified the settings.xml file while Red Hat JBoss Developer Studio was running, you must refresh 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.

    Figure 7.1. Update Maven User Settings

Result

Maven has been configured to use the online repositories provided for your Red Hat JBoss product.

Important

If your cached local Maven repository contains outdated artifacts, you may encounter one of the following Maven errors when you build or deploy your project:

  • Missing artifact ARTIFACT_NAME
  • [ERROR] Failed to execute goal on project PROJECT_NAME; Could not resolve dependencies for PROJECT_NAME

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.

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat