Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-27085

No package dependencies for NuGet package if nuspec have no dependencies versions

    Details

    • Type: Bug
    • Status: New
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.29.1, 3.29.2, 3.30.0
    • Fix Version/s: None
    • Component/s: NuGet, nuget-v3
    • Labels:
    • Environment:
      docker container, CentOs 7.7

      Description

      Screenshot of API response is in the attachment.

      Problem in that package, in fact, have dependencies, but they not appear in API or Web-interface.

       

      How to reproduce:

      • Let's take some nuspec like below. Without dependencies

       <?xml version="1.0" encoding="utf-8"?>
      <package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
      <metadata>
      <id>Kontur.ID8986</id>
      <version>1.0.0</version>
      <authors>idevops@place.com</authors>
      <owners>idevops@place.com</owners>
      <requireLicenseAcceptance>false</requireLicenseAcceptance>
      <description>Issue reproduction package</description>
      <tags>idevops issue nexus</tags>
      <dependencies>
      <dependency id="JetBrains.Annotations" version="2020.3.0" />
      <dependency id="Newtonsoft.Json" version="12.0.3" />
      </dependencies>
      </metadata>
      </package>
      Now let's try to pack this.
       nuget pack ID8986.nuspec -version 1.0.1
       

      There will be warning, but still package will be successfully created.
       Attempting to build package from 'ID8986.nuspec'.
      WARNING: NU5112: The version of dependency 'JetBrains.Annotations' is not specified. Specify the version of dependency and rebuild your package.
      Successfully created package 'C:\temp\Kontur.ID8986.1.0.1.nupkg'.
      Push package to hosted repo
       push Kontur.ID8986.1.0.1.nupkg -ForceEnglishOutput -NonInteractive -Verbosity detailed -ApiKey ${ApiKey} -Source https://mynexusinstance.com/repository/hosted-nuget/
      Package will be successfully pushed without any warnings
       NuGet Version: 5.7.0.6726
      Pushing Kontur.ID8986.1.0.1.nupkg to 'https://mynexusinstance.com/repository/hosted-nuget/'...
      PUT https://mynexusinstance.com/repository/hosted-nuget/
      Created https://mynexusinstance.com/repository/hosted-nuget/ 280ms
      Your package was pushed.
      Little offtop:

      NuGet Gallery will now allow push such package via web-interface with warning (screenshot in the attachment)

      Now let's open the catalogue and we will see that dependency group is empty (screenshot in the attachment)

      {{}}

        Attachments

        1. NuGetDepsEmpty.png
          NuGetDepsEmpty.png
          45 kB
        2. GalleryBlock.png
          GalleryBlock.png
          18 kB
        3. EmptyDepsCatalogue.png
          EmptyDepsCatalogue.png
          27 kB

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            Dimis Dmitry
            Last Updated By:
            Adam Greene Adam Greene
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Date of First Response:

                tigCommentSecurity.panel-title