How to create an offline Maven repository for Red Hat build of Apache Camel 4.x for Spring Boot?
Environment
- Red Hat build of Apache Camel for Spring Boot
- 4.4.x and higher
Issue
- How to create an offline Maven repository for Red Hat build of Apache Camel for Spring Boot?
- We run in a no-Internet environment. How can we build and run Camel applications in a disconnected environment?
- Where is the offline Maven repository for Red Hat build of Apache Camel for Spring Boot?
Resolution
Starting from Red Hat build of Apache Camel for Spring Boot users can build their own offline repository.
For every release of Red Hat build of Apache Camel for Spring Boot users can download the following file from the This content is not included.Red Hat Customer Portal:
Red Hat build of Apache Camel 4.x for Spring Boot 3.x Offline Maven Repository Builder
The file being downloaded is a zip file that contains everything to build an offline Maven repository for this specific release.
The first step is to unzip the downloaded file. The directory structure of the archive is as follows:
├── README
├── build-offline-repo.sh
├── errors.log
├── logback.xml
├── maven-repositories.txt
├── offliner-2.0-sources.jar
├── offliner-2.0-sources.jar.md5
├── offliner-2.0.jar
├── offliner-2.0.jar.md5
├── offliner.log
├── rhaf-camel-offliner-4.4.0.txt
└── rhaf-camel-spring-boot-offliner-4.4.0.txt
The provided READMEfile explains the steps and commands required for building the offline Maven repository.
Logging can be configured via the provided logback.xml.
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 will display a summary of the downloaded and failed artifacts, but we also recommend to scan through errors.logfor any download failures. There will quite likely be some errors reported. Most of them can be ignored, see Diagnostics section below for more details.
If any artifacts failed to be downloaded, it may help to simply 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.
If needed, the tool can be configured 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.
If you are behind a HTTP proxy and any HTTP calls need to go via this proxy, then the script may need to be changed. The line in the script that invokes the JVM will need to get the arguments --proxy <proxy-host> --proxy-user <proxy-user> --proxy-pass <proxy-pass> added.
The shell script build-offline-repo.sh can also be used with option -v to print the version number of the script. That version is the version number of the script and not related to the Red Hat build of Apache Camel product version.
Diagnostic Steps
When running the offliner script, it will most likely report some errors. The Camel components camel-sap and camel-cics use non-public libraries that users will need to bring along in order to use these components. So there will be errors about some sapj and ctg libraries.
In addition errors about camel-spring-boot-dependencies-generator, redhat-camel-spring-boot-bom-generator, narayana-spring-boot-starter-it can be ignored as these are never required at build time or runtime.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.