WhoAmI
WhoAmI

Reputation: 1133

Artifactory jfrog - download artifact with regex and exclude

I'm just trying to download every artifact for example:

maven-dsd-snapshot-local/com/dsds/aem/tenants/dcihub/dcihub-wrapper/1221.1.0-SNAPSHOT
/something-wrapper-2023.1.0-20230206.113149-31.zip

but NOT

maven-dsd-snapshot-local/com/dsds/aem/platform/platform-wrapper/2023.1.0-SNAPSHOT/platform-wrapper-2023.1.0-20230206.113149-51.zip

That is what I'm trying to do in Jenkins using Artifactory plugin:

    Artifactory_BUILD_PATH = """{
                   "files": [
                  {
                    "pattern": "${repo}/(?!.*platform-wrapper).*-wrapper/.*.zip",
                    "target": "/tmp/artifacts/",
                    "flat": "true",
                    "build": "${buildName}/LATEST"
                  }
                 ]
                }"""

However when I do that I get:

  java.lang.ArrayIndexOutOfBoundsException

With negative regex this works and match correctly all the wrapper paths:

    Artifactory_BUILD_PATH = """{
                   "files": [
                  {
                    "pattern": "${repo}/*-wrapper/*.zip",
                    "target": "/tmp/artifacts/",
                    "flat": "true",
                    "build": "${buildName}/LATEST"
                  }
                 ]
                }"""

END GOAL: Match all paths that have wrapper in it, but exclude platform-wrapper.

Upvotes: 0

Views: 1060

Answers (1)

Prostagma
Prostagma

Reputation: 1851

The download command only supports wildcards. It does not support regular expressions.

You can make use of the exclusions field in order to exclude certain paths.

See the File Specs documentation for more details.

Upvotes: 2

Related Questions