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

StyleCop support in Violations plugin can't deal with absolute paths.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • violations-plugin
    • None
    • Platform: PC, OS: Windows XP

      Using version 0.7.3 of the Violations plugin.

      I'm building a .Net project and using Stylecop 4.3. I've generated the stylecop
      XML report using StyleCopCmd on my Visual Studio 2k5 solution file and it
      generated XML like this:

      stylecop-output.xml:
      <?xml version="1.0" standalone="yes"?>
      <StyleCopReport xmlns="http://stylecopcmd.sourceforge.net/StyleCopReport.xsd">
      <Solutions>
      <ID>0</ID>
      <Location>D:\CI\jobs\TW
      COMS\workspace\twcoms_v\Order_Management_Products_VOB\TraderWorkstationMS\Dev\OrderManagement\OrderManagement.sln</Location>
      <Name>OrderManagement</Name>
      <Projects>
      <ID>0</ID>
      <Location>D:\CI\jobs\TW
      COMS\workspace\twcoms_v\Order_Management_Products_VOB\TraderWorkstationMS\Dev\OrderManagement\OrderManagement\OrderManagement.csproj</Location>
      <Name>OrderManagement</Name>
      <SolutionID>0</SolutionID>
      <SourceCodeFiles>
      <ID>0</ID>
      <Path>D:\CI\jobs\TW
      COMS\workspace\twcoms_v\Order_Management_Products_VOB\TraderWorkstationMS\Dev\OrderManagement\OrderManagement\config\IOperatorIdManagerConfiguration.cs</Path>
      <TimeStamp>2009-04-16T08:35:49+10:00</TimeStamp>
      <Type>CS</Type>
      <Name>IOperatorIdManagerConfiguration.cs</Name>
      <CodeProjectID>0</CodeProjectID>
      </SourceCodeFiles>
      ... etc

      stylecop-output.violations.xml:
      <StyleCopViolations>
      <Violation
      Section="Root.com.gsjbw.traderworkstation.services.clientordermanagement.config.ConfigUtils.CreateConfigurationException%string%string[]"
      LineNumber="18" Source="D:\CI\jobs\TW
      COMS\workspace\twcoms_v\Order_Management_Products_VOB\TraderWorkstationMS\Dev\OrderManagement\OrderManagement\config\ConfigUtils.cs"
      RuleNamespace="Microsoft.StyleCop.CSharp.DocumentationRules"
      Rule="ElementsMustBeDocumented" RuleId="SA1600">The method must have a
      documentation header.</Violation>
      <Violation
      Section="Root.com.gsjbw.traderworkstation.services.clientordermanagement.config.ISonicJmsConfiguration.JmsDelayEnabled"
      LineNumber="34" Source="D:\CI\jobs\TW
      COMS\workspace\twcoms_v\Order_Management_Products_VOB\TraderWorkstationMS\Dev\OrderManagement\OrderManagement\config\ISonicJmsConfiguration.cs"
      RuleNamespace="Microsoft.StyleCop.CSharp.DocumentationRules"
      Rule="ElementsMustBeDocumented" RuleId="SA1600">The property must have a
      documentation header.</Violation>

      Etc...

      NOTE the absolute path names for the Source attribute.

      With the violations plugin enabled for the build and "XML filename pattern"
      set to "*/build/stylecop-output.xml" I get the following exception. Note I
      have not set the "Faux Project Directory" or "Source Path Pattern" settings to
      anything. If this is the problem what should I be setting them to? They
      documentation is not clear. My code does not existing in a single directory
      like Java code usually does. All code is beneath this directory though:
      D:\CI\jobs\TW
      COMS\workspace\twcoms_v\Order_Management_Products_VOB\TraderWorkstationMS\Dev

      The exception text:

      FATAL: D:\CI\jobs\TW
      COMS\builds\2009-04-21_15-23-54\violations\file\twcoms_v\Order_Management_Products_VOB\TraderWorkstationMS\Dev\OrderManagement\build\D:\CI\jobs\TW
      COMS\workspace\twcoms_v\Order_Management_Products_VOB\TraderWorkstationMS\Dev\Shared\ServiceUtility\exception\GSJBWTimeoutException.cs.xml
      (The filename, directory name, or volume label syntax is incorrect)
      java.io.FileNotFoundException: D:\CI\jobs\TW
      COMS\builds\2009-04-21_15-23-54\violations\file\twcoms_v\Order_Management_Products_VOB\TraderWorkstationMS\Dev\OrderManagement\build\D:\CI\jobs\TW
      COMS\workspace\twcoms_v\Order_Management_Products_VOB\TraderWorkstationMS\Dev\Shared\ServiceUtility\exception\GSJBWTimeoutException.cs.xml
      (The filename, directory name, or volume label syntax is incorrect)
      at java.io.FileOutputStream.open(Native Method)
      at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
      at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
      at hudson.FilePath.write(FilePath.java:906)
      at
      hudson.plugins.violations.generate.ExecuteFilePath.execute(ExecuteFilePath.java:40)
      at hudson.plugins.violations.generate.GenerateXML.execute(GenerateXML.java:47)
      at
      hudson.plugins.violations.ViolationsCollector.invoke(ViolationsCollector.java:124)
      at
      hudson.plugins.violations.ViolationsCollector.invoke(ViolationsCollector.java:27)
      at hudson.FilePath.act(FilePath.java:552)
      at
      hudson.plugins.violations.ViolationsPublisher.perform(ViolationsPublisher.java:77)
      at
      hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:56)
      at
      hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:372)
      at
      hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:360)
      at hudson.model.Build$RunnerImpl.post2(Build.java:183)
      at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:345)
      at hudson.model.Run.run(Run.java:943)
      at hudson.model.Build.run(Build.java:112)
      at hudson.model.ResourceController.execute(ResourceController.java:93)
      at hudson.model.Executor.run(Executor.java:119)

            kohsuke Kohsuke Kawaguchi
            orj76 orj76
            Votes:
            11 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated: