Uploaded image for project: 'Maven SCM'
  1. Maven SCM
  2. SCM-390

scm:branch gives misleading error when branch name parameter is missing

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0
    • 1.1
    • maven-plugin
    • None
    • Patch

    Description

      Running scm:branch without a branch name results in the misleading error:

      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] Cannot run branch command :
      
      Embedded error: Exception while executing SCM command.
      Missing parameter: 'branchName'.
      [INFO] ------------------------------------------------------------------------
      

      The actual branch name parameter is called 'branch', but the error message complains about a missing 'branchName' parameter. This is due to the discrepancy between scm command and mojo parameter names.

      A good fix would be to mark the branch name mojo parameter as required, since the goal is pretty useless without it. This gives a better error message:

      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] One or more required plugin parameters are invalid/missing for 'scm:branch'
      
      [0] Inside the definition for plugin 'maven-scm-plugin' specify the following:
      
      <configuration>
        ...
        <branch>VALUE</branch>
      </configuration>
      
      -OR-
      
      on the command line, specify: '-Dbranch=VALUE'
      
      [INFO] ------------------------------------------------------------------------
      

      Attachments

        1. SCM-390.patch
          0.5 kB
          Mark Hobson

        Activity

          People

            siveton Siveton Vincent
            markh Mark Hobson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: