Uploaded image for project: 'Maven Archetype'
  1. Maven Archetype
  2. ARCHETYPE-283

archetype:generate does not use <localRepository> in settings.xml when looking for archetype-catalog.xml

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-alpha-4
    • Fix Version/s: 3.0.0
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows XP, Maven 2.2.1, maven-archetype-plugin 2.0-alpha4

      Description

      'mvn archetype:generate -DarchetypeCatalog=local' always looks in ~/.m2/archetype-catalog.xml i.e. it will always look in the USER_HOME/archetype-catalog.xml regardless of whether the local repository location has been overridden in the settings.xml.

      You can verify this by deleting your archetype-catalog.xml in your home directory and creating a new one in a different directory - which you then specify in settings.xml e.g.:

      <localRepository>D:\differentrepo</localRepository>

      This will not pick up the archetype when running 'mvn archetype:generate -DarchetypeCatalog=local'. Now copy a valid archetype catalog to your home directory e.g. ~/.m2/archetype-catalog.xml and run 'mvn archetype:generate -DarchetypeCatalog=local' and you will see it is not using the localRepository from the settings.xml but somewhere it is hardcoded to use the user's home directory /.m2/.

        Activity

        Hide
        rfscholte Robert Scholte added a comment -

        All hard reference to the ${user.home}/.m2 have been replaced with the localRepository provided by Maven. This should not be an issue anymore.

        Show
        rfscholte Robert Scholte added a comment - All hard reference to the ${user.home}/.m2 have been replaced with the localRepository provided by Maven. This should not be an issue anymore.
        Hide
        michael-o Michael Osipov added a comment -

        Reopened as per request.

        Show
        michael-o Michael Osipov added a comment - Reopened as per request.
        Hide
        hacst Stefan Hacker added a comment -

        This issue should be reopened. The bug still exists in current versions and is quite annoying if you don't use the default maven repository location.

        Show
        hacst Stefan Hacker added a comment - This issue should be reopened. The bug still exists in current versions and is quite annoying if you don't use the default maven repository location.
        Hide
        michael-o Michael Osipov added a comment -

        Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014 if you're wondering why this issue was closed out.

        Show
        michael-o Michael Osipov added a comment - Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014 if you're wondering why this issue was closed out.

          People

          • Assignee:
            rfscholte Robert Scholte
            Reporter:
            christos444 ChristopherC
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development