Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-22386

Warnings Plugin cannot show details for MSBuild warnings

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • warnings-plugin
    • Windows 7 x64, US English
      MSBuild 12.0.30110.0
      Single Jenkins server running on this machine. No slaves involved.

      Warnings Plugin set to "Scan console log"
      Parser set to MSBuild

      Warnings Plugin correctly identifies the warning and shows its summary in the "MSBuild Warnings" page.
      However, when I click on the link to show the file containing the specific warning, I get a stack trace from java.io.FileInputStream.open (attached).

      Additional info:
      I tried this with "Resolve relative paths" both checked and unchecked. It did not seem to make any difference.
      I also tried using MSBuild both with and without the "/m" command-line option for building multiple projects in parallel. This option changes the console log format by appending the parallel build number to all lines of text. The Warnings Plugin was not affected by either setting of /m.

      I think the problem is caused by MSBuild's output format which is:
      Filename(line,column) : warning <number>: description [full path to project file]

      I think the solution is to get the directory from project file and then append the relative filename of the file containing the warning. For example:
      PbuAfg.cs(90,9): warning CS0168: The variable 'warnme' is declared but never used [C:\Program Files (x86)\Jenkins\workspace\gurb\Platforms\Afg\PbuAfg\PbuAfg.csproj]

      The file containing the warning is: PbuAfg.cs
      The project file is: C:\Program Files (x86)\Jenkins\workspace\gurb\Platforms\Afg\PbuAfg\PbuAfg.csproj

      Get the directory part of the project: C:\Program Files (x86)\Jenkins\workspace\gurb\Platforms\Afg\PbuAfg\
      Append the filename: C:\Program Files (x86)\Jenkins\workspace\gurb\Platforms\Afg\PbuAfg\PbuAfg.cs

      This yields the full path to the file.

            drulli Ulli Hafner
            redtracy Bob Tracy
            Votes:
            5 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: