从压缩的Artifactory工件下载单个文件 [英] Download single file from zipped Artifactory artifact
问题描述
我有一个Gradle构建,它将zip存档发布到Artifactory.某些下游用例需要zip工件中的单个文件,因此下载整个存档的效率很低.是否可以从zip归档文件中下载单个文件?
I have a Gradle build which is publishing a zip archive to Artifactory. Some downstream use cases require a single file from the zip artifact, so downloading the entire archive is inefficient. Is it possible to download a single file from within the zip archive?
我怀疑归档文件的创建方式存在问题.如果这是一个提示,则无法通过Web查看器扩展zip内容.
I suspect an issue in the way the archive is being created. I cannot expand the zip contents through the web viewer, if that is a clue.
以下是用于创建zip工件的Gradle代码:
Here is the Gradle code used to create the zip artifact:
task buildZip(type: Zip) {
description 'Create the ZIP file'
classifier = System.env.CLASSIFIER
extension = 'zip'
def archive_loc = System.env.FOLDER_TO_ZIP
from archive_loc
}
推荐答案
Artifactory允许使用以下符号从档案文件(Zip,Jar,War等)下载特定文件:
Artifactory allows downloading a specific file from an archive (Zip, Jar, War etc.) using the following notation:
http://localhost:8081/artifactory/repo-name/path/to/archive.zip!/path/to/file
有关更多详细信息,请参见存档条目的文档下载 REST API方法
For more details see the documentation for the Archive Entry Download REST API method
这篇关于从压缩的Artifactory工件下载单个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!