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

release:perform in subdirectories fails if localCheckout=true

    Details

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

      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

          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.
          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.
          Hide
          Jukka Zitting 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 Zitting 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.
          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!

            People

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

              Dates

              • Created:
                Updated:
                Resolved: