A path pattern is constructed of tokens (explained below), path separators ('/
'), optional parentheses ('(
' and ')
') and literals ('.
', '-
', etc.). Tokens are modeled after module fields, as presented above.
Path patterns can be defined for every artifact in the repository or you can define separate path patterns for descriptor-type artifacts (such as a .pom
or an ivy.xml
file).
The following tokens are available:
Token | Description |
---|---|
[org] | Represents the Organization field where the levels are separated by dots (' |
[orgPath] | Represents the Organization field where the levels are separated by path separators (' |
[baseRev] | Represents the Base Revision field |
[module] | Represents the Module field |
[folderItegRev] | Represents the Folder Integration Revision field |
[fileItegRev] | Represents the File Integration Revision field |
[classifier] | Represents the Classifier field |
[ext] | Represents the Extension field |
[type] | Represents the Type field |
[customTokenName<customTokenRegex>] | A custom token. Can be used to create a new type of token when the provided defaults are insufficient. For example, |
Custom tokens
When using custom tokens in the repository layout, make sure that the layout begins with [orgPath]/[module]
. If the [module]
token is missing in the layout, some REST API calls will not work.
Multiple Custom Tokens
Artifactory supports any number of custom tokens, but when provided with multiple custom tokens of the same key, Artifactory only takes into account the regular expression of the first occurrence while substituting the rest with a repetition expression (even if each occurrence has a different regular expression value.
For example:
[custom1<.+>]/[custom1<.*>]/[custom1<[0-9]+>]
Translates to:
<custom1>.+/\1/\1
Optional parts
To specify tokens or a sequence of tokens and literals as optional in the path pattern, surround the sequence with the optional parentheses '(
' and ')
' literals.
For example, the pattern "[module](
-[classifier])
" matches both "bobs-tools-sources
" and "bobs-tools
", and the pattern "[baseRev](-[fileItegRev])
" matches both "1.2-SNAPSHOT
" and "1.2
".