Maven Archetype
  1. Maven Archetype
  2. ARCHETYPE-89

archetypeng:create doesn't use configured repos to find artifacts

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Incomplete
    • Affects Version/s: 2.0-alpha-2
    • Fix Version/s: 2.0-alpha-5
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      I deployed a snapshot of the archetype and create isn't finding it even though i have the maven-snapshot repo in my settings. A secondary problem is that if nothing is found, you get into an infinite loop where it asks you to pick a number that isn't there.

      $ mvn.bat archetypeng:create
      Using maven.home=c:\Program Files\maven2\bin\\..
      [INFO] Scanning for projects...
      [INFO] Searching repository for plugin with prefix: 'archetypeng'.
      [INFO] ----------------------------------------------------------------------------
      [INFO] Building Maven Default Project
      [INFO]    task-segment: [archetypeng:create] (aggregator-style)
      [INFO] ----------------------------------------------------------------------------
      [INFO] Preparing archetypeng:create
      [INFO] [archetypeng:select-archetype]
      Choose group:
      1: org.apache.maven.archetypes
      2: org.codehaus.mojo.archetypes
      3: org.apache.maven.its
      Choose a number:  (1/2/3): 3
      [INFO] org.apache.maven.its: checking for updates from central
      Choose archetype:
      Choose a number: :
      

        Issue Links

          Activity

          Hide
          Raphaël Piéroni added a comment -

          About the repositories in settings.
          There is a maven issue (can remember which exactly) that state that
          repositories defined in profiles in settings are not usable in a directory
          that doesn't contain a pom. therefore the archetype plugin can't use it...

          A workaround is usable: the archetype:add-repositories goal
          that takes -DrepositoryId=central and -DrepositoryUrl=http://repo1.maven.org/maven2 properties
          or -Drepositories=central=http://repo1.maven.org/maven2,company1=http://repo1.company.com property

          About the infinite loop, It is a bug

          Show
          Raphaël Piéroni added a comment - About the repositories in settings. There is a maven issue (can remember which exactly) that state that repositories defined in profiles in settings are not usable in a directory that doesn't contain a pom. therefore the archetype plugin can't use it... A workaround is usable: the archetype:add-repositories goal that takes -DrepositoryId=central and -DrepositoryUrl= http://repo1.maven.org/maven2 properties or -Drepositories=central= http://repo1.maven.org/maven2,company1=http://repo1.company.com property About the infinite loop, It is a bug
          Hide
          Raphaël Piéroni added a comment -

          The loop behaviour is separated in ARCHETYPE-93

          Show
          Raphaël Piéroni added a comment - The loop behaviour is separated in ARCHETYPE-93
          Hide
          brianfox brianfox added a comment -

          I think you could read the settings.xml file directly to find the repositories? Having another goal is not ideal, we need this to be as easy as possible.

          Show
          brianfox brianfox added a comment - I think you could read the settings.xml file directly to find the repositories? Having another goal is not ideal, we need this to be as easy as possible.
          Hide
          Raphaël Piéroni added a comment -

          About the 'other goal':

          4 lists of configuration are located in the registry (~/.m2/archetype.xml);
          They contain the groupIds, the repositories, the languages and the filtereds:

          • groupIds are used for prompting the user
          • repositories are used to retrieve the maven metadatas to propose the archetype and version selection
          • languages are directory names that contains 'packaged' sources and used during the create-from-project
          • filtered are file extensions that are used to separate velocity templates from binary files and used during create-from-project

          Some goals are provided to administer the registry file.
          There is add-Xs, remove-Xs, show-Xs for each of the 4 lists in the registry.
          Of course one can still edit that file by hands

          These mojos exist since late april but not documented

          About the settings reading,

          When i started, i used the repositories defined in the project, thinking the repositories defined in profiles in settings would be used. But they weren't.
          I also desired to have the settings holds archetype groups like it holds the plugins groups. but it was too much change for the plugin only archetypeng was at this time.
          I then decided to create the registry file to contains these 2 configuration lists. And when i wrote create-from-project, i used the registry to hold 2 more configuration lists. Hence the other goals.

          Show
          Raphaël Piéroni added a comment - About the 'other goal': 4 lists of configuration are located in the registry (~/.m2/archetype.xml); They contain the groupIds, the repositories, the languages and the filtereds: groupIds are used for prompting the user repositories are used to retrieve the maven metadatas to propose the archetype and version selection languages are directory names that contains 'packaged' sources and used during the create-from-project filtered are file extensions that are used to separate velocity templates from binary files and used during create-from-project Some goals are provided to administer the registry file. There is add-Xs, remove-Xs, show-Xs for each of the 4 lists in the registry. Of course one can still edit that file by hands These mojos exist since late april but not documented About the settings reading, When i started, i used the repositories defined in the project, thinking the repositories defined in profiles in settings would be used. But they weren't. I also desired to have the settings holds archetype groups like it holds the plugins groups. but it was too much change for the plugin only archetypeng was at this time. I then decided to create the registry file to contains these 2 configuration lists. And when i wrote create-from-project, i used the registry to hold 2 more configuration lists. Hence the other goals.
          Hide
          Raphaël Piéroni added a comment -

          The issue MNG-3099 defines the repository part of this issue

          Show
          Raphaël Piéroni added a comment - The issue MNG-3099 defines the repository part of this issue
          Hide
          Raphaël Piéroni added a comment -

          Changing issues to be fixed at next release

          Show
          Raphaël Piéroni added a comment - Changing issues to be fixed at next release
          Hide
          Brett Porter added a comment -

          all the data in this issue seems obsolete, but I have a different problem that would fall under the same description.

          The repository URL should not be hardcoded into the internal catalog - it is looking at repo1, when really it should be looking at the repository defined by central (ie, the one in my settings file that points to my internal repository proxy). So, it needs to honour settings. I believe the catalog should specify and id and a url - and if the id exists use that instead (and if not, fall back to the URL).

          Show
          Brett Porter added a comment - all the data in this issue seems obsolete, but I have a different problem that would fall under the same description. The repository URL should not be hardcoded into the internal catalog - it is looking at repo1, when really it should be looking at the repository defined by central (ie, the one in my settings file that points to my internal repository proxy). So, it needs to honour settings. I believe the catalog should specify and id and a url - and if the id exists use that instead (and if not, fall back to the URL).
          Hide
          Raphaël Piéroni added a comment -

          This issue is no longer accurate.
          Brett, can you please create a new issue with your particular problem,
          if this is still a problem. Thanks.

          Show
          Raphaël Piéroni added a comment - This issue is no longer accurate. Brett, can you please create a new issue with your particular problem, if this is still a problem. Thanks.
          Hide
          Brett Porter added a comment -

          created ARCHETYPE-179

          Show
          Brett Porter added a comment - created ARCHETYPE-179

            People

            • Assignee:
              Raphaël Piéroni
              Reporter:
              brianfox brianfox
            • Votes:
              3 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: