Maven SCM
  1. Maven SCM
  2. SCM-338

NullPointerException when using -DvssDirectory to set ss.exe path

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: 1.1
    • Component/s: maven-scm-provider-vss
    • Labels:
      None
    • Environment:
      Windows XP, JRE 1.4.2
    • Flags:
      Patch

      Description

      NullPointerException occurs with any SCM operation when there is no ~/.scm/vss-settings.xml file, and when the vssDirectory system property is set:

      Caused by: java.lang.NullPointerException
              at org.apache.maven.scm.provider.vss.commands.VssCommandLineUtils.getSettings(VssCommandLineUtils.java:137)
              at org.apache.maven.scm.provider.vss.commands.VssCommandLineUtils.getSsDir(VssCommandLineUtils.java:145)
              at org.apache.maven.scm.provider.vss.commands.changelog.VssHistoryCommand.buildCmdLine(VssHistoryCommand.java:91)
              at org.apache.maven.scm.provider.vss.commands.changelog.VssHistoryCommand.executeChangeLogCommand(VssHistoryCommand.java:53)
              at org.apache.maven.scm.command.changelog.AbstractChangeLogCommand.executeCommand(AbstractChangeLogCommand.java:101)
              at org.apache.maven.scm.command.AbstractCommand.execute(AbstractCommand.java:58)
              ... 21 more
      

      This error is easily replicated using the attached project vssproviderbug.zip. Unzip the archive and run

      mvn scm:changelog -DvssDirectory=something -e
      

      Assuming the file ~/.scm/vss-settings.xml does not exist, you should see the above error in the stack traces. Note that you don't need VSS installed (or even to be on Windows) in order to replicate the error - Maven doesn't actually get as far as making a call to ss.exe.

      1. vssproviderbug.zip
        3 kB
        Allan Lang
      2. SCM-338-maven-scm-provider-vss.patch
        0.6 kB
        Allan Lang
      3. SCM-338-[02]-maven-scm-provider-vss.patch
        6 kB
        Allan Lang

        Activity

        Allan Lang created issue -
        Hide
        Allan Lang added a comment -

        Suggested patch for above issue. Simply instantiates Settings in order to avoid NPE.

        Show
        Allan Lang added a comment - Suggested patch for above issue. Simply instantiates Settings in order to avoid NPE.
        Allan Lang made changes -
        Field Original Value New Value
        Attachment SCM-338-maven-scm-provider-vss.patch [ 29248 ]
        Hide
        Allan Lang added a comment -

        Updated patch SCM-338-[02]-maven-scm-provider-vss.patch includes a new test case for the VssCommandLineUtils, which previously didn't have one.

        The test needs to manipulate the ~\.scm\vss-settings.xml file on disk, which may be a bit suspect depending on how the project is build in CI, so please take a look at what's going on in VssCommandLineUtilsTest.

        Show
        Allan Lang added a comment - Updated patch SCM-338 - [02] -maven-scm-provider-vss.patch includes a new test case for the VssCommandLineUtils , which previously didn't have one. The test needs to manipulate the ~\.scm\vss-settings.xml file on disk, which may be a bit suspect depending on how the project is build in CI, so please take a look at what's going on in VssCommandLineUtilsTest .
        Allan Lang made changes -
        Attachment SCM-338-[02]-maven-scm-provider-vss.patch [ 29253 ]
        Emmanuel Venisse made changes -
        Fix Version/s 1.1 [ 13984 ]
        Emmanuel Venisse made changes -
        Patch Submitted [Yes]
        Hide
        Emmanuel Venisse added a comment -

        Patch applied with some changes

        Show
        Emmanuel Venisse added a comment - Patch applied with some changes
        Emmanuel Venisse made changes -
        Assignee Emmanuel Venisse [ evenisse ]
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 12:22:36 UTC 2015 [ 1428236556206 ]
        Mark Thomas made changes -
        Workflow jira [ 12725348 ] Default workflow, editable Closed status [ 12757988 ]
        Mark Thomas made changes -
        Patch Submitted Yes [ 10763 ]
        Flags Patch [ 10430 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 01:08:37 UTC 2015 [ 1428282517778 ]
        Mark Thomas made changes -
        Workflow jira [ 12963232 ] Default workflow, editable Closed status [ 13000464 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Closed Closed
        256d 8h 32m 1 Emmanuel Venisse 15/May/08 15:30

          People

          • Assignee:
            Emmanuel Venisse
            Reporter:
            Allan Lang
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development