简体   繁体   English

无法使用 curl 从 Nexus 下载工件

[英]Not able to download artifact from Nexus using curl

I am trying to download an artifact from Nexus Pro 3.37.3-02 using curl but it is not working.我正在尝试使用 curl 从 Nexus Pro 3.37.3-02 下载工件,但它不起作用。 I have found below commands which I think working for many other but in my case I am getting repository, maven.groupId, maven.artifactId, maven.baseVersion, maven.extension is not recognized as internal or external command, operable program or batch files.我发现下面的命令我认为适用于许多其他但在我的情况下我正在获取存储库,maven.groupId,maven.artifactId,maven.baseVersion,maven.extension 未被识别为内部或外部命令,可操作程序或批处理文件.

curl -u usename:password -L -X GET https://MY_NEXUS/service/rest/v1/search/assets/download?sort=version&repository=MY-REPO&maven.groupId=MY_GROUP&maven.artifactId=MY_ARTIFACT_NAME&maven.baseVersion=0.1-SNAPSHOT&maven.extension=zip curl -u usename:password -L -X GET https://MY_NEXUS/service/rest/v1/search/assets/download?sort=version&repository=MY-REPO&maven.groupId=MY_GROUP&maven.artifactId=MY_ARTIFACT_NAME&maven.baseVersion=0&maven-SNAPSHOT .extension=zip

I have followed this documentation to make this command.我已按照此文档来执行此命令。 https://help.sonatype.com/repomanager3/integrations/rest-and-integration-api/search-api https://help.sonatype.com/repomanager3/integrations/rest-and-integration-api/search-api

Any help will be appreciated.任何帮助将不胜感激。 Thanks,谢谢,

In case if anyone else facing the same problem then this is the solution which worked for me.如果其他人遇到同样的问题,那么这就是对我有用的解决方案。

curl -u token:tokenPassword -L -X GET "https://MY_NEXUS/service/rest/v1/search/assets/download?sort=version&repository=MY-REPO&group=MY_GROUP&name=MY_ARTIFACT_NAME&version=MY_Version&maven.extension=zip" --output My_Artifact.zip

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM