Maven
  1. Maven
  2. MNG-2662

SettingsBuilder internally converts network paths to local paths and is therefore preventing the use of network profiles

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.4
    • Fix Version/s: 2.0.7
    • Component/s: Settings
    • Labels:
      None
    • Environment:
      Windows XP, Domain-Environment, Network User-Profile
    • Complexity:
      Intermediate
    • Patch Submitted:
      Yes
    • Number of attachments :
      2

      Description

      I'm not sure if this is a bug or intended but the DefaultMavenSettingsBuilder converts paths like "\\server\username\.m2\settings.xml" to "<Current Drive>:\server\username\.m2\settings.xml". This prevented us from using the default user.home because our userprofiles are located on another server and are referenced by "
      " network paths. It would've been quite complicated to change the user.home system property for all developers, so we fixed the problem by removing a regular expression that replaced double backslashes by only one, followed by calling "new File(path).getAbsolutePath()" which added the current drive letter to the path and converted it to a local path this way.

      I don't know the reason for removing double backslashes from the beginning but at least i didn't recognize any problems with my changes yet. It would be nice if somebody could tell me what the regexp was intended for. I attached a patch to this posting and hope it helps!

      1. maven-settings-patch-PROPER.diff
        1 kB
        Daniel Bechler
      2. patch.diff
        1 kB
        Daniel Bechler

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              John Casey
              Reporter:
              Daniel Bechler
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: