0
votes

I'm using the ArtiFactory MsBuild plugin to publish to a NuGet repository on my continuous integration build.

The issue is when I create a new project that's using my NuGet package it is also pulling down ArtiFactory plugin and its dependencies. The project code doesn't use ArtiFactory, only the build process.

How do I change my package to not include the Artifactory plugin and its dependencies?

I've tried removing the artifactory repository from the project I'm publishing, but it fails on the CI build because artifactory needed for the MsBuild task to run and fails the build.

2

2 Answers

1
votes

Here are two solutions for the problem:

  • Since Artifactory plugin is installed per solution, you can create a new project in it, install the plugin for this project and set the deployment flag of this project to false. This way the plugin will be installed, but the artifacts of the plugin won't be uploaded.
  • Another (and more clear solution) would be using the exclude patterns to exclude the artifactory dll and its dependencies.
0
votes

I used the following work around:

  1. Copy files from $(Solution directory)\packages\Artifactory.1.0.0\lib\net45 to $(Solution directory.artifactory
  2. In the Visual Studio Solution, Add the 3 dlls as existing files to the .artifactory solution directory.
  3. Edit .artifactory\Deploy.targets file and replace the following line: (around line 14)

a.

<UsingTask TaskName="JFrog.Artifactory.ArtifactoryBuild" AssemblyFile="$(solutionDir)\packages\Artifactory.$(pluginVersion)\lib\net45\JFrog.Artifactory.dll" />

with

b. <UsingTask TaskName="JFrog.Artifactory.ArtifactoryBuild" AssemblyFile="$(solutionDir)\.artifactory\JFrog.Artifactory.dll" />

  1. Remove references from the project to JFrog.Artifactory.dll, Microsoft.Web.XmlTransoform.dll and NuGet.Core.dll
  2. Remove references from packages.config for JFrog.Artifactory.dll, Microsoft.Web.XmlTransoform.dll and NuGet.Core.dll
  3. Remove Dependencies from .nuspec file