1.安装nuget.exe ,下载地址https://www.nuget.org/downloads,下载后直接将nuget.exe拷贝到C:\Windows\System32目录下
2.cmd执行 nuget setapikey e500146f-8594-32a3-9041-6ad7d2bf8d9b -source http://192.168.10.22:8081/repository/nuget-hosted/ 为仓库设置apikey
3.执行powershell脚本,批量将nuget包上传到Nexus私有仓库,脚本如下
$destFolder = Get-Location; cd ..\.. $rootFolder=Get-Location; #编译anycpu的包 $anycpuPath =$rootFolder.Path + "\src\Infrastructures\Adnc.Infra.sln"; $output=$destFolder.Path+"\packages" Write-Output $anycpuPath dotnet restore $anycpuPath dotnet build --no-restore -c Release $anycpuPath dotnet pack $anycpuPath -c Release --output $output; cd $output nuget push *.nupkg -Source http://192.168.10.22:8081/repository/nuget-hosted/ pause exitShell
4.到Nexus查看包推送结果
标签:anycpuPath,Nexus,nuget,dotnet,output,推送 From: https://www.cnblogs.com/shuyuansong/p/18535544