Maven
  1. Maven
  2. MNG-5258

localRepository in settings.xml does not handle ~ as home.dir

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.1, 3.0.4
    • Fix Version/s: 3.1.0-alpha-1
    • Component/s: Bootstrap & Build, Settings
    • Labels:
      None
    • Environment:
      Linux (Ubuntu 11.10), Java 6

      Description

      My provided settings.xml contained a localRepository part with the value ~/.m2/repository and when invoking any maven command, this caused issues.

      Steps to reproduce:

      1 - create a settings.xml with the following content:
      <settings>
      <!-- localRepository

      The path to the local repository maven will use to store artifacts.
      Default: ~/.m2/repository -->
      <localRepository>~/.m2/repository</localRepository>
      </settings>

      2 - run mvn clean in an existing project

      3 - maven will create a ~ directory in the project where it will download all artifacts to.

      Apart from essentially creating a private repository for each project (which can quickly take up way more space than necessary, cause issues about missing artifacts) it may also cause issues if you try to remove it and forget to escape the ; ie if you do rm -rf ~ instead of rm -rf ''.

      I also tested with maven 2.2.1 and that will blow up with errors about not being able to create /.m2/repository/<some path to an artifact>.

      Both 3.0.4 and 2.2.1 were downloaded from maven.apache.org, not installed via apt/dpkg.

        Activity

        Mark Thomas made changes -
        Workflow jira [ 12952812 ] Default workflow, editable Closed status [ 12990142 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 21:45:26 UTC 2015 [ 1428270326204 ]
        Mark Thomas made changes -
        Workflow jira [ 12715478 ] Default workflow, editable Closed status [ 12755016 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 08:49:45 UTC 2015 [ 1428223785911 ]
        Jason van Zyl made changes -
        Fix Version/s 3.1.0 [ 18967 ]
        Fix Version/s 3.1.x [ 18129 ]
        Robert Scholte made changes -
        Fix Version/s 3.0.5 [ 18129 ]
        Assignee Olivier Lamy [ olamy ] Robert Scholte [ rfscholte ]
        Status Reopened [ 4 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Thomas Zeeman made changes -
        Status Closed [ 6 ] Reopened [ 4 ]
        Resolution Not A Bug [ 6 ]
        Olivier Lamy (*$^¨%`£) made changes -
        Field Original Value New Value
        Assignee Olivier Lamy [ olamy ]
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Not A Bug [ 6 ]
        Thomas Zeeman created issue -

          People

          • Assignee:
            Robert Scholte
            Reporter:
            Thomas Zeeman
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development