Artifactory JFrog – 使用正则表达式和排除功能下载构件。

huangapple go评论78阅读模式
英文:

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."

英文:

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.

答案1

得分: 2

下载命令仅支持通配符。它不支持正则表达式。

您可以使用“排除”字段来排除特定路径。

有关更多详细信息,请参阅文件规范文档

英文:

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.

huangapple
  • 本文由 发表于 2023年2月6日 21:13:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/75361777.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定