Using an external Maven repository

To build decision service archives, execute decision services that use the execution Java™ API, or compile external libraries, you must have the appropriate Java™ libraries and Maven plug-ins installed. These dependencies are designed to be pulled from Maven and can be installed to a Maven repository.

About this task

Automation Decision Services provides Maven plug-ins to generate decision libraries and decision service archives.

Table 1 and Table 2 show the JAR files for Maven plug-ins that are available from <DECISION_DESIGNER_SERVER_URL>. You can see files that are available from <DECISION_DESIGNER_SERVER_URL>/download/.

Table 1. Maven plug-ins used for decision services
Purpose Plug-in

To compile decision service archives

  • build-maven-plugin-VERSION.jar

To compile decision service archives and the external libraries of Automation Decision Services

  • foundation-VERSION.jar

To manually upgrade a decision service to the current version

  • upgrade-maven-plugin-VERSION.jar

To execute decision service archives while performing unit tests

  • engine-compact-runtime-VERSION.jar

To be used for machine learning

You need them to use predictive models.

  • ml-integration-runtime-VERSION.jar

To create JSON-based decision test suites

  • engine-de-api-VERSION.jar
Table 2. Maven plug-ins used for external libraries
Purpose Plug-in

To compile decision service archives and the external libraries of Automation Decision Services

  • foundation-VERSION.jar

To be used by the external libraries feature of Automation Decision Services

  • build-import-maven-plugin-VERSION.jar
  • annotations-VERSION.jar

To generate POM files for external libraries

For more information, see Creating a POM file for an external library.

  • maven-archetype-external-library-VERSION.jar

Table 3 lists the JAR files that must be downloaded for your applications that use the execution Java™ API for Automation Decision Services. The JAR files must be added to the class path in your applications.

For more information about the API, see Executing decision services with execution Java API.
Table 3. JAR files for execution Java API
Purpose JAR

To use execution Java API for decision services

  • execution-api-VERSION.jar
  • engine-de-api-VERSION.jar

Procedure

  1. Download the Maven plug-ins and Java libraries. You can either use cURL or the user interface to download the files.

    When you download using cURL, use the file <DECISION_DESIGNER_SERVER_URL>/index.json to determine which version of each plug-in to use, or to automate the download and install process.

    To access the Maven plug-ins, get a Zen API key from a Zen user (with zen user role).

    For more information, see Authorizing HTTP requests by using the Zen API key.

    To download files with cURL, run the following command:
    curl -k -s -H "Authorization: ZenApiKey $(printf "<ZEN_USERNAME>:<ZEN_APIKEY>" | base64)" <DECISION_DESIGNER_SERVER_URL>/build-maven-plugin_<VERSION>.jar -o build-maven-plugin_<VERSION>.jar
    The following example shows the cURL command to download JAR files for execution Java API:
    curl -k -s -H "Authorization: ZenApiKey $(printf "<ZEN_USERNAME>:<ZEN_APIKEY>" | base64)" <DECISION_DESIGNER_SERVER_URL>/execution-api_<EXECUTION_API_VERSION>.jar -o execution-api_<EXECUTION_API_VERSION>.jar

    To download files using the user interface, go to <DECISION_DESIGNER_SERVER_URL>/download.

  2. If you do not have a Maven repository server, or if you want to build decision archives on your local machine, install the Maven artifacts in your local Maven installation.

    To install a JAR used by the Maven, extract GAV External link opens a new window or tab parameters from index.json and install as follows.

    mvn install:install-file -Dfile=<PATH_TO_JAR_FILE>
  3. If you have a Maven repository server as part of your CI/CD infrastructure, deploy the Maven artifacts.

    If you use a binary repository manager, like Sonatype Nexus or JFrog Artifactory, you must deploy the Maven plug-ins to the remote Maven repository of the binary repository manager. The credentials for <REPOSITORY_ID> are set in your ${user.home}/.m2/settings.xml file.

    <settings>
      ...
      <servers>
        <server>
          <id><REPOSITORY_ID></id>
          <username><ARTIFACTS_SERVER_USERNAME></username>
          <password><ARTIFACTS_SERVER_PASSWORD></password>
        </server>
      ...
      </servers>
      ...
    </settings>

    For each artifact without a POM file, run the following command using deploy-maven-plugin version greater than 2.7:

    mvn deploy:deploy-file -DgroupId=<GROUP_ID> -DartifactId=<ARTIFACT_ID> -Dversion=<VERSION> -Dpackaging=jar -DrepositoryId=<REPOSITORY_ID> -Durl=<ARTIFACTS_SERVER_URL> -Dfile=<PATH_TO_JAR_FILE>