简体   繁体   English

使用针对.net项目的Jenkins Artifactory插件解析Artifactory Pro中的nuget软件包

[英]Resolve nuget packages from Artifactory Pro using Jenkins Artifactory plugin for .net projects

Mainly used for : C# project, nuget package dependencies, MSBuild build tool (no TFS) 主要用于:C#项目,nuget包依赖项,MSBuild构建工具(无TFS)

We are evaluating Artifactory Pro eval version, Jenkins for CI & dependency management. 我们正在评估Artifactory Pro评估版Jenkins,用于CI和依赖项管理。 Currently, I have setup Jenkins to use the "Generic-Artifactory integration" build environment to resolve/restore nuget packages from Artifactory. 当前,我已经设置Jenkins以使用“ Generic-Artifactory集成”构建环境来解析/恢复Artifactory中的nuget包。 I am able to access artifactory from Jenkins and see the various repos. 我可以从詹金斯(Jenkins)访问工件,并查看各种回购。

All I am looking to see is to have the Jenkins CI use the Artifactory plugin to fetch Nuget packages from Artifactory. 我希望看到的是让Jenkins CI使用Artifactory插件从Artifactory获取Nuget软件包。 If the nuget packages are not cached currently in Artifactory, I will go fetch it from Nuget gallery ( https://www.nuget.org ) and cache them in one of remote repos in Artifactory. 如果nuget软件包当前不在Artifactory中缓存,我将从Nuget画廊( https://www.nuget.org )中获取它,并将其缓存在Artifactory中的一个远程仓库中。 Then the subsequent builds can then fetch from this Artifactory cache repo for any nuget dependencies. 然后可以从此Artifactory缓存回购中获取后续构建,以获取任何nuget依赖项。 How do i do this with Jenkins CI, MSbuild tool, Artifactory Pro eval version. 我如何使用Jenkins CI,MSbuild工具,Artifactory Pro评估版进行此操作。

IMO the fastest and easiest way to do that is to use the MsBuild Artifactory plugin . IMO最快最简单的方法是使用MsBuild Artifactory插件 This plugin is a simple extension for Visual Studio which allows you to add a new project type to your solution. 该插件是Visual Studio的简单扩展,它允许您向解决方案中添加新的项目类型。 By doing it you will be able to control how to resolve nuget dependencies from Artifactory and what you want to publish in your repos. 通过这样做,您将能够控制如何解决来自Artifactory的nuget依赖关系以及要在存储库中发布的内容。

Also I recommend using a single virtual repository for your case and to aggregate in it a local which will be your target for deployment and a remote connected to the official nuget gallery. 另外,我建议针对您的案例使用一个虚拟存储库,并在其中聚合一个本地资源(将作为您的部署目标)和一个与官方nuget画廊连接的远程对象。

Also you can watch this webinar about the MsBuild Artifactory plugin. 您也可以观看有关MsBuild Artifactory插件的网络研讨会 It is showing how to use it with TFS but the idea is the same for Jenkins as the plugin is simply an extension to the MsBuild process. 它显示了如何在TFS中使用它,但是对于Jenkins来说,想法是相同的,因为该插件只是MsBuild流程的扩展。

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

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