Artifacts are the physical files that make up a specific version of an application. For example, an application binary, configuration files, or web content. When adding an artifact to a deployment package, you can either:

  • Upload an artifact that will be stored in the XL Deploy internal repository
  • Specify the uniform resource identifier (URI) of an externally stored artifact, which XL Deploy will resolve when it needs to access the file.

Set the URI of a deployable artifact

If you set the file URI (fileUri) property of an artifact configuration item (CI) to a URI, XL Deploy uses an artifact resolver to resolve the URI when it needs access to the artifact. Example: When you set up a deployment, XL Deploy will download the artifact temporarily to perform certain actions on it. After deployment is complete, XL Deploy will delete its temporary copy of the artifact.

By default, XL Deploy supports Maven repositories, including Artifactory and Nexus, and HTTP/HTTPS locations. You can also add your own custom artifact resolver. For more information, see Extending the external artifact storage feature.

Important: The value of the fileUri property must be a stable reference, it must point to the same file whenever it is referenced. “Symlink”-style references, such as a link to the latest version, are not supported.

Changing the URI of a deployable artifact

Important: Do not change the file URI property after saving the artifact CI.

XL Deploy performs URI validation, checksum calculation, and placeholder scanning once, after the creation of the artifact configuration item (CI). It does not perform these actions again if the fileUri property is changed.

If you are using the XL Deploy internal repository, changing the URI of a saved CI can result in orphaned artifact files that cannot be removed by the garbage collection mechanism.

If you want to change the file URI, create a new CI for the artifact.

Use a Maven repository URI

The URI of a Maven artifact must start with maven:, followed by Maven coordinates. Example:

maven:com.acme.applications:PetClinic:1.0

For information about configuring your Maven repository, see Configure XL Deploy to fetch artifacts from a Maven repository.

Important: References to SNAPSHOT versions are not supported because these are not stable references.

XL Deploy searches for the artifact during initial deployments and update deployments. If the artifact is missing from the repository, the search will return an error. You can configure XL Deploy to serve an empty artifact for the deployment to continue. This option is not recommended, as it can cause issues that are hard to debug. To enable this option, set xl-platform.extensions.resolver.maven.ignoreMissingArtifact in the conf/maven.conf file, to:

xl.repository.artifact.resolver.maven.ignoreMissingArtifact = true

Note: As of XL Deploy version 8.6, the maven.conf file was deprecated. The configuration properties from this file have been migrated to the xl block of the xl-deploy.conf file. For more information, see XL Deploy configuration files.

Use a HTTP or HTTPS URI

You can use an HTTP or HTTPS reference in the fileUri property. XL Deploy will attempt to get the filename from the Content-Disposition header of the HEAD request, and then from the Content-Disposition header of the GET request. If neither is available, XL Deploy will get the filename from the last segment of the URI.

You can specify authentication credentials using only one of these methods:

  1. Specify basic HTTP credentials in the URI. Example:
     http://admin:admin@example.com/artifact.jar
    
  2. Select credentials from an existing set of credentials defined in XL Deploy. For more information, see Store credentials in XL Deploy. Example:
     http://example.com/artifact.jar
    

    To connect using HTTPS with a self-signed SSL certificate, you must configure the JVM parameters of XL Deploy to trust your certificate.

XL Deploy looks up the artifact during initial deployments and update deployments. If the URL returns a 404 error, the lookup will return an error. You can configure XL Deploy to serve an empty artifact so that the deployment can continue. This option is not recommended, as it can cause issues that are hard to debug. To enable this option, set xl-platform.extensions.resolver.http.ignoreMissingArtifact in the conf/extensions.conf file, to:

xl.repository.artifact.resolver.http.ignoreMissingArtifact = true

Note: As of XL Deploy version 8.6, the extensions.conf file was deprecated. The configuration properties from this file have been migrated to the xl block of the xl-deploy.conf file. For more information, see XL Deploy configuration files.

Create a deployment package using the CLI

This example shows how you can create a deployment package with an externally stored artifact using the XL Deploy CLI:

myApp = factory.configurationItem('Applications/myApp', 'udm.Application')
repository.create(myApp)
myApp1_0 = factory.configurationItem('Applications/myApp/1.0', 'udm.DeploymentPackage')
repository.create(myApp1_0)
myFile = factory.configurationItem('Applications/myApp/1.0/myFile', 'file.File', {'fileUri': 'http://example.com.com/artifact.war'})
repository.create(myFile)