Maven Release Plugin
  1. Maven Release Plugin
  2. MRELEASE-740

release:perform in subdirectories fails if localCheckout=true

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3
    • Component/s: Git, perform
    • Labels:
      None

      Description

      This bug only concerns DSCMs like hg or GIT.

      Currently the release:perform fails when the project which should be released is not in the outermost directory of the SCM repository and the localCheckout feature is enabled. In this case we just do a file:// checkout from the current directory. But if the project being released is not in the outermost directory, then the present working directory doesn't contain a GIT repo but some parent directory does.
      This is related to MRELEASE-501.

        Issue Links

          Activity

          Mark Struberg created issue -
          Hide
          Mark Struberg added a comment -

          fixed in r1245806.

          we now move up to the parent directories if the local checkout fails - until we hit the root or the checkout succeeds.

          Show
          Mark Struberg added a comment - fixed in r1245806. we now move up to the parent directories if the local checkout fails - until we hit the root or the checkout succeeds.
          Mark Struberg made changes -
          Field Original Value New Value
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Closed [ 6 ]
          Fix Version/s 2.2.3 [ 18334 ]
          Assignee Mark Struberg [ struberg ]
          Hide
          Florent PAILLARD added a comment - - edited

          Hello Mark,

          Thanks a lot for fixing this! That's really precious!

          I encounter 2 little problems under Windows.

          First one is when the scmUrl is built. In CheckoutProjectFromScm class at line 88.
          Under Windows, providing a url of the form "scm:git:file://d:/users/blabla/etc/" is resolved by Git a "file://d/users/blabla/etc". Note that the /d:/ became /d/. Then git fails because it cannot checkout this not existing directory.
          The workaround is to provide a url of the form: "scm:git:file:///d:/users/blabla/etc/" (with a triple slash "///" between file: and d
          I don't know if it also works under other systems.

          Second problem is when you get to the parent folder to try to checkout. Also in CheckoutProjectFromScm class at line 107. Instead of
          int lastSlashPos = scmPath.lastIndexOf( "/" )
          it should be
          int lastSlashPos = scmPath.lastIndexOf( System.getProperty("file.separator") )

          That would be really great if you could fix that before the next MRELEASE version! Do I need to create a new issue for that?

          Kind Regards,

          Show
          Florent PAILLARD added a comment - - edited Hello Mark, Thanks a lot for fixing this! That's really precious! I encounter 2 little problems under Windows. First one is when the scmUrl is built. In CheckoutProjectFromScm class at line 88. Under Windows, providing a url of the form "scm:git: file://d:/users/blabla/etc/ " is resolved by Git a "file://d/users/blabla/etc". Note that the /d:/ became /d/. Then git fails because it cannot checkout this not existing directory. The workaround is to provide a url of the form: "scm:git: file:///d:/users/blabla/etc/ " (with a triple slash "///" between file: and d I don't know if it also works under other systems. Second problem is when you get to the parent folder to try to checkout. Also in CheckoutProjectFromScm class at line 107. Instead of int lastSlashPos = scmPath.lastIndexOf( "/" ) it should be int lastSlashPos = scmPath.lastIndexOf( System.getProperty("file.separator") ) That would be really great if you could fix that before the next MRELEASE version! Do I need to create a new issue for that? Kind Regards,
          Hide
          Mark Struberg added a comment -

          Txs Florent! I'll fix those little bugs asap.

          Show
          Mark Struberg added a comment - Txs Florent! I'll fix those little bugs asap.
          Mark Struberg made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Hide
          Jukka N added a comment -

          Any thoughts on when version 2.3 will be out? I'd really love to see this fix in an official release.

          Show
          Jukka N added a comment - Any thoughts on when version 2.3 will be out? I'd really love to see this fix in an official release.
          Hide
          Mark Struberg added a comment -

          Hi Florent!

          Can you please test the following patch?

          Please note that this also requires the patch from MRELEASE-727 as well! Otherwise the correct path will not be found.

          Show
          Mark Struberg added a comment - Hi Florent! Can you please test the following patch? Please note that this also requires the patch from MRELEASE-727 as well! Otherwise the correct path will not be found.
          Mark Struberg made changes -
          Attachment MRELEASE-740.patch [ 59745 ]
          Hide
          Florent PAILLARD added a comment -

          Hi Mark

          It works here under Windows !

          Thanks

          Show
          Florent PAILLARD added a comment - Hi Mark It works here under Windows ! Thanks
          Hide
          Mark Struberg added a comment -

          committed in r1332386.

          txs for the patch Florent!

          Show
          Mark Struberg added a comment - committed in r1332386. txs for the patch Florent!
          Mark Struberg made changes -
          Status Reopened [ 4 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Robert Scholte made changes -
          Component/s Git [ 14642 ]
          Component/s perform [ 13616 ]
          Robert Scholte made changes -
          Link This issue is duplicated by MRELEASE-754 [ MRELEASE-754 ]
          Mark Struberg made changes -
          Link This issue is related to MRELEASE-727 [ MRELEASE-727 ]
          Mark Struberg made changes -
          Link This issue is related to MRELEASE-501 [ MRELEASE-501 ]
          jurevert made changes -
          Link This issue supercedes MRELEASE-702 [ MRELEASE-702 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 12:15:05 UTC 2015 [ 1428236105845 ]
          Mark Thomas made changes -
          Workflow jira [ 12724553 ] Default workflow, editable Closed status [ 12763728 ]
          Mark Thomas made changes -
          Project Import Mon Apr 06 00:52:26 UTC 2015 [ 1428281546237 ]
          Mark Thomas made changes -
          Workflow jira [ 12962213 ] Default workflow, editable Closed status [ 12999808 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Closed Closed
          10m 17s 1 Mark Struberg 17/Feb/12 17:24
          Closed Closed Reopened Reopened
          70d 22h 30m 1 Mark Struberg 28/Apr/12 16:55
          Reopened Reopened Closed Closed
          2d 6m 1 Mark Struberg 30/Apr/12 17:02

            People

            • Assignee:
              Mark Struberg
              Reporter:
              Mark Struberg
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development