9.4. Preparing a Maven mirror repository for offline use
If your Red Hat Decision Manager deployment does not have outgoing access to the public Internet, you must prepare a Maven repository with a mirror of all the necessary artifacts and make this repository available to your environment.
You do not need to complete this procedure if your Red Hat Decision Manager deployment is connected to the Internet.
Prerequisites
- A computer that has outgoing access to the public Internet is available.
Procedure
On the computer that has an outgoing connection to the public Internet, complete the following steps:
- Download the latest version of the Offliner tool.
-
Download the
rhdm-7.5.1-offliner.txtproduct deliverable file from the Software Downloads page of the Red Hat Customer Portal. Enter the following command to use the Offliner tool to download the required artifacts:
java -jar offliner-<version>.jar -r https://maven.repository.redhat.com/ga/ -r https://repo1.maven.org/maven2/ -d /home/user/temp rhdm-7.5.1-offliner.txt
Replace
/home/user/tempwith an empty temporary directory and<version>with the version of the Offliner tool that you downloaded. The download can take a significant amount of time.
If you developed services outside Business Central and they have additional dependencies, add the dependencies to the mirror repository. If you developed the services as Maven projects, you can use the following steps to prepare these dependencies automatically. Complete the steps on the computer that has an outgoing connection to the public Internet.
-
Create a backup of the local Maven cache directory (
~/.m2/repository) and then clear the directory. -
Build the source of your projects using the
mvn clean installcommand. For every project, enter the following command to ensure that Maven downloads all runtime dependencies for all the artifacts generated by the project:
mvn -e -DskipTests dependency:go-offline -f /path/to/project/pom.xml --batch-mode -Djava.net.preferIPv4Stack=true
Replace
/path/to/project/pom.xmlwith the correct path to thepom.xmlfile of the project.-
Copy the contents of the local Maven cache directory (
~/.m2/repository) to the temporary directory that you are using.
-
Create a backup of the local Maven cache directory (
- Copy the contents of the temporary directory to a directory on the computer on which you deployed Red Hat Decision Manager. This directory becomes the offline Maven mirror repository.
-
Create and configure a
settings.xmlfile for your Red Hat Decision Manager deployment, according to instructions in 「Modifying the Maven settings file」. Make the following changes in the
settings.xmlfile:-
Under the
<profile>tag, if a<repositories>or<pluginRepositores>tag is absent, add the tags as necessary. Under
<repositories>add the following sequence:<repository> <id>offline-repository</id> <url>file:///path/to/repo</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository>Replace
/path/to/repowith the full path to the local Maven mirror repository directory.Under
<pluginRepositories>add the following sequence:<repository> <id>offline-plugin-repository</id> <url>file:///path/to/repo</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository>Replace
/path/to/repowith the full path to the local Maven mirror repository directory.
-
Under the