7.4. Configuring Maven to Use the Online Repositories
Procedure 7.2. Configuring Maven to Use the Online Repositories
- Add entries for the online repositories and configuration of authentication for accessing them to Maven's
settings.xmlfile 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>http://maven.repository.redhat.com/techpreview/all</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>jboss-ga-plugin-repository</id> <url>http://maven.repository.redhat.com/techpreview/all</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> </pluginRepositories> </profile> </profiles> <!-- 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> --> <activeProfiles> <!-- Activation of the BRMS/BPMS profile --> <activeProfile>brms-bpms-online-profile</activeProfile> </activeProfiles> </settings> - If you modified the
settings.xmlfile while JBoss Developer Studio was running, you must refresh Maven settings in the IDE. From the menu, choose → . In the Preferences Window, expand Maven and choose User Settings. Click the button to refresh the Maven user settings in JBoss Developer Studio.
Figure 7.2. Update Maven User Settings
Maven has been configured to use the online repositories provided for your Red Hat JBoss product.
Important
- Missing artifact ARTIFACT_NAME
- [ERROR] Failed to execute goal on project PROJECT_NAME; Could not resolve dependencies for PROJECT_NAME
~/.m2/repository/ directory on Linux or the %SystemDrive%\Users\USERNAME\.m2\repository\ directory on Windows. This will force Maven to download correct versions of required artifacts during the next build.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.