Offline installation
Axiomatics Policy DevOps (APD) downloads Gradle, the Gradle plugins, and its libraries from the internet: from the Gradle servers, Maven Central, and the Axiomatics Maven repository. For environments where internet access is limited, or restricted to internal corporate networks, you can install and run APD in one of two modes:
- Offline mode: without any network access, such as in an air-gapped network. Axiomatics provides all files, which you copy into your project.
- Local mode: with access to your corporate network only. Your corporate artifact server, such as Artifactory or Nexus, provides the files.
Offline mode
Complete all actions that require internet access, such as downloading the files below, before you move them to the air-gapped environment. Then, install APD in offline mode.
Before you start, make sure you have a JDK 17 and Git installed. Offline, Gradle cannot download the JDK that APD uses to compile and run the tests, so it must be installed.
-
Clone the APD project from GitHub. If you cannot clone from GitHub, ask for the APD files together with the Maven repository clone in step 2.
git clone https://github.com/axiomatics/axiomatics-policy-devopsnoteAlternatively, you can download the repo contents as a ZIP fileOpens in a new tab.
-
Contact Axiomatics through the Support portalOpens in a new tab to request the Maven repository clone. Specify your preferred delivery method, such as a secure third-party file-sharing service or an HTTPS download link for transfer to an offline machine.
infoThe repository clone is a large ZIP file containing JAR and POM files. If its size is a concern, use local mode instead.
-
Copy the ZIP contents into the root of your ALFA Git project. If prompted, overwrite
gradle-wrapper.properties. -
Verify the following:
ALFA_PROJECT_ROOT/lib/exists and contains the local Maven repository and its subfolders.ALFA_PROJECT_ROOT/gradle/wrapper/gradle-<version>-bin.zipexists.- In
ALFA_PROJECT_ROOT/gradle/wrapper/gradle-wrapper.propertiesthe keydistributionUrlno longer points to a HTTPS URL but to the local filegradle-<version>-bin.zip.
-
Make sure APD runs in offline mode by executing a task, such as:
- Windows
- Linux
gradlew test./gradlew testIf the installation is successful, you should see:
Running in offline mode using local repository at <project directory>/lib
Committing offline mode changes
Committing offline mode changes will add a large amount of binaries to your ALFA Git repository. This practice violates Git best practices and can negatively impact the performance of your central build server, as this data must be checked out for every build.
Therefore, it is recommended to avoid committing these changes. Add lib/ and gradle/wrapper/gradle-*-bin.zip to the .gitignore file, and do not commit the changed gradle/wrapper/gradle-wrapper.properties.
Local mode
Local mode eliminates the need for internet access but requires intranet (corporate) network access. In this mode, your software/artifacts server (Artifactory, Nexus, etc.) hosts and provides the JAR files.
-
Import the Axiomatics Maven clone you received to your software/artifacts server.
-
Reconfigure the APD Gradle project by adding your corporate repositories. Add your corporate repository first within each
repositories {block in the repository sections of the following files:settings.gradle, inpluginManagement { repositories { } }: the Gradle pluginsbuildSrc/build.gradlebuildSrc/src/main/groovy/axiomatics-policy-devops.gradle
noteThe specific method for adding your repository depends on your organization's setup. Consult your support team for guidance.
warningWhen you update APD, the
buildSrc/directory is replaced, andsettings.gradleis taken from the new version except for yourrootProject.name. After each update, add your corporate repositories to the three files again. See Update.
You can also host the Gradle distribution on a local software server. Upload the distribution to your server and update distributionUrl in gradle/wrapper/gradle-wrapper.properties to reference it.