res-deploy-xom
The res-deploy-xom task deploys a set of XOM, JAR, ZIP, or Java™ resources to a running Rule Execution Server instance. The task uploads the archive through Hypertext Transfer Protocol (HTTP) or an HTTP Over SSL (HTTPS).
When you deploy a set of XOM, JAR, ZIP, or Java resources with the jarMajorVersion increment policy set to true, each new JAR file that is deployed to Rule Execution Server (that is, with the same name but a different SHA-1 checksum) is deployed with an incremented major version. If you set the jarMajorVersion increment policy to false, the minor version of the new JAR file is incremented. In contrast, the existing resources (that is, with the same name and same SHA-1 checksum) are not deployed again.
If you use the libName attribute to specify a library name, the res-deploy-xom task creates a library name to contain the set of XOM, JAR, ZIP, or Java resources that you pass. When you create the library with the libMajorVersion increment policy set to true, the existing library is redeployed to Rule Execution Server with an incremented major version. If you set the libMajorVersion increment policy to false, the minor version of the new library is incremented.
res-deploy-xom nested element
The xompath nested
element specifies a Path-like
structure
. All the files included in this path are placed in
the internal layer of the Rule Execution Server console
as a JAR resource, in the same order as listed in the path. The xompath element
supports the nested fileset element. See FileSet
.
res-deploy-xom element attributes
The following table describes the element attributes of the res-deploy-xom Ant task and specifies whether they are mandatory or optional.
| Element attribute | Description | Mandatory/optional |
|---|---|---|
| authorizationToken |
Supports token authentication by using OpenID Connect. If you set this attribute, it takes precedence over the credentialsfile, userid, and password attributes. |
Optional |
| credentialsfile | A file that contains the userid and password values,
encrypted the first time the attribute is used. If you set this attribute, do not use the
userid and password attributes.A credentials file is a text file that sets two properties: username and password. |
Optional |
| failonerror | If you set this attribute to false, a warning message is logged when an error occurs, but the build process is not stopped. | Optional The default value is true. |
| jarMajorVersion | The server uses the version policy to process the XOM, JAR, ZIP, or Java resources. If you set this attribute to true, the major version is incremented, if applicable. Otherwise, the minor version is incremented. | Optional The default value is false. |
| hostname | The host name of the server where the Rule Execution Server console is installed. | Mandatory |
| libMajorVersion | The server uses the version policy to process the library. If you set this attribute to true, the major version is incremented, if applicable. Otherwise, the minor version is incremented. | Optional The default value is false. |
| libMergingPolicy | The server uses the merging policy to process the library. This
attribute can take the following values:
|
Optional |
| libName | The server uses this name to create a library. If you do not set this attribute, no library is created and the other library attributes, libMajorVersion and libMergingPolicy, are ignored. | Optional |
| outputRulesetProperty | If you set this attribute, the result of the computed property ruleset.managedxom.uris is assigned to a new property that is created with the given name. To rename a resource inside the internal persistence, the best way is to rename the JAR file before the deployment process. | Optional |
| password | The password of the user who is allowed to log in to the Rule Execution Server console. If you set this attribute, do not use the credentialsfile attribute. | Optional |
| portnumber | The port number of the Rule Execution Server console. | Mandatory |
| secured | If you set this attribute to true, the task works through an HTTPS connection. | Optional The default value is false. |
| userid | The user name to log in to Rule Execution Server console. If you set this attribute, do not use the credentialsfile attribute. The user must be assigned the resDeployer role or above. | Optional |
| webapp | The context root of the Rule Execution Server console | Optional The default value is res. |
Example: Deploying resources to a file
<target name="runloanvalidation">
<res-deploy-xom
hostname="localhost"
portnumber="9080"
webapp="res"
userid="resAdmin"
password="resAdmin"
jarMajorVersion="false"
libName="person"
outputRulesetProperty="ruleset.managedxom.uris">
<xompath>
<fileset dir="hello">
<include name="*.jar"/>
</fileset>
</xompath>
</res-deploy-xom>
<echo message="Resulting property: ${ruleset.managedxom.uris}"/>
</target>Example: Encrypted credentials for JAR resources deployment
<res-deploy-xom hostname="localhost"
portnumber="9080"
credentialsfile="credentials.properties"
jarMajorVersion="true">
<xompath>
<fileset dir="./javaxoms">
<include name="**/*.jar"/>
</fileset>
</xompath>
</res-deploy-xom>username=resAdmin
password=resAdminCredentials file must comply with the Java format for
property files. For more information, see the Java documentation
).
username={AES}6ee3l4NrmD3p8QTViSszow\=\=
password={AES}6ee3l4NrmD3p8QTViSszow\=\=By using encryption, you ensure that the user name and password are never displayed in plain text in traces while JAR files are deployed.
Example: Passing a trusted key for SSL authentication
set ANT_OPTS=-Djavax.net.ssl.trustStore=cacerts.jks
ant my-https-deploy-xom-task