Este contenido no está disponible en el idioma seleccionado.
Appendix B. Using Red Hat Maven repositories
This section describes how to use Red Hat-provided Maven repositories in your software.
B.1. Using the online repository Copiar enlaceEnlace copiado en el portapapeles!
Red Hat maintains a central Maven repository for use with your Maven-based projects. For more information, see the repository welcome page.
There are two ways to configure Maven to use the Red Hat repository:
Adding the repository to your Maven settings
This method of configuration applies to all Maven projects owned by your user, as long as your POM file does not override the repository configuration and the included profile is enabled.
Procedure
Locate the Maven
settings.xmlfile. It is usually inside the.m2directory in the user home directory. If the file does not exist, use a text editor to create it.On Linux or UNIX:
/home/<username>/.m2/settings.xml
/home/<username>/.m2/settings.xmlCopy to Clipboard Copied! Toggle word wrap Toggle overflow On Windows:
C:\Users\<username>\.m2\settings.xml
C:\Users\<username>\.m2\settings.xmlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add a new profile containing the Red Hat repository to the
profileselement of thesettings.xmlfile, as in the following example:Example: A Maven
settings.xmlfile containing the Red Hat repositoryCopy to Clipboard Copied! Toggle word wrap Toggle overflow
For more information about Maven configuration, see the Maven settings reference.
Adding the repository to your POM file
To configure a repository directly in your project, add a new entry to the repositories element of your POM file, as in the following example:
Example: A Maven pom.xml file containing the Red Hat repository
For more information about POM file configuration, see the Maven POM reference.
B.2. Using a local repository Copiar enlaceEnlace copiado en el portapapeles!
Red Hat provides file-based Maven repositories for some of its components. These are delivered as downloadable archives that you can extract to your local filesystem.
To configure Maven to use a locally extracted repository, apply the following XML in your Maven settings or POM file:
<repository>
<id>red-hat-local</id>
<url>${repository-url}</url>
</repository>
<repository>
<id>red-hat-local</id>
<url>${repository-url}</url>
</repository>
${repository-url} must be a file URL containing the local filesystem path of the extracted repository.
| Operating system | Filesystem path | URL |
|---|---|---|
| Linux or UNIX |
|
|
| Windows |
|
|