4.3. Building an offline Maven repository
Red Hat build of Apache Camel for Spring Boot users can build their own offline Maven repository which is used in a restricted environment. For each release of Red Hat build of Apache Camel for Spring Boot users can download the zip file from the Red Hat Customer Portal.
Procedure
- Download the offile Maven repository builder from the customer portal. For example, for Red Hat build of Camel Spring Boot version 4.10, use the Offline Maven builder.
- The downloaded file is a zip file that contains everything to build an offline Maven repository for this specific release.
Unzip the downloaded zip file. The directory structure of the archive is as follows:
├──build-offline-repo.sh ├──logback.xml ├──maven-repositories.txt ├──offliner-2.2.jar ├──offliner-2.2.jar.md5 ├──offliner-2.2-sources.jar ├──offliner-2.2-sources.jar.md5 ├──README ├──rhaf-camel-offliner-4.10.3.txt └──rhaf-camel-spring-boot-offliner-4.10.3.txtThis zip contains the following files:
- build-offline-repo.sh - A wrapper script around the Offliner tool.
- offliner-2.0.jar - Downloads the artifacts in the manifest.
redhat-camel-4.8.0-offline-manifest.txt
- Lists the required artifacts that need to be downloaded.
redhat-camel-spring-boot-4.8.0-offline-manifest.txt
- Lists the required artifacts that need to be downloaded.
- README - Explains the steps and commands required for building the offline Maven repository.
-
To build an offline repository, run the
build-offline-repo.shscript as per instructions given in theREADMEfile. Optionally you can specify a directory where the artifacts should be downloaded to. If not specified, a directory called 'repository' is created in the current working directory.
If needed, you can configure the tool to use additional Maven repositories, by adding them to file maven-repositories.txt. This is generally not necessary as the tool is pre-configured with the right set of Maven repositories.
In case of a HTTP proxy and any HTTP calls that need to go via this proxy, you may need to change the script. Add the arguments --proxy <proxy-host> --proxy-user <proxy-user> --proxy-pass <proxy-pass> in the line that invokes the JVM in the script.
You can use the option -v to print the version number of the script. This version is the version number of the script and not related to the Red Hat build of Apache Camel product version.
Troubleshooting
You can configure the logging via the provided logback.xml file. When the shell script is executed, any download activity will be written to the log file offliner.log and any download failures are listed in errors.log. At the end of the execution the offliner tool displays a summary of the downloaded and failed artifacts, but we also recommend to scan through errors.log for any download failures.
If any artifacts are failed to be downloaded, re-run the tool against the same target folder. The tool will avoid to download artifacts that it already downloaded and only attempt those that it failed on previously.