Introducing Matrix Parameters
Matrix parameters key-value pairs parameters separated by a semicolon (;) that you can place anywhere on a URI.
This is a standard method for specifying parameters in HTTP (in addition to querying parameters and path parameters).
Artifactory makes use of matrix parameters for:
Dynamically Adding Properties to Artifacts on Deployment
You can add key-value matrix parameters to deploy (PUT) requests and those are automatically transformed to properties on the deployed artifact.
Since matrix parameters can be added on any part of the URL, not just at the end, you can add them to the target deployment base URL. At the time of deployment, the artifact path is added after the matrix parameters and the final deployed artifact will be assigned the defined properties.
You can even use dynamic properties, depending on our deployment framework.
When using Maven, for instance, you can add two parameters to the deployment URL:
And deploy to the
Upon deployment the URL is transformed to:
And the deployed
Controlling Artifact Resolution with Matrix Parameters Queries
Matrix parameters can be used to control how artifacts are found and served.
There is currently support for two types of property that can be used for resolution:
Non-mandatory properties are specified by a simple
Specifying a non-mandatory property in a query means that artifacts should be returned if at least one of the following two conditions is met:
Mandatory properties are specified using a plus sign together with the equals in the key-value pair:
Specifying a mandatory property in a query means that an artifact should only be returned if at has a key-value pair exactly matching the key-value pair in the query.
A matrix parameter may specify a key-value pair with multiple values separated by a comma. This means that the artifact should be returned if it contains the property with any of the specified values