Maven Archetype
  1. Maven Archetype
  2. ARCHETYPE-351

Maven central is not used for archetype repository anymore

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.1
    • Component/s: Generator
    • Labels:
      None
    • Environment:
      OS X, maven 3.
    • Number of attachments :
      0

      Description

      In maven 2.2.1, the following command would create a Grails 1.3.4 project, using the archetype at http://repo1.maven.org/maven2/org/grails/grails-maven-archetype/1.3.4/

      mvn archetype:generate -DarchetypeGroupId=org.grails \
          -DarchetypeArtifactId=grails-maven-archetype \
          -DarchetypeVersion=1.3.4 \
          -DgroupId=example -DartifactId=my-app
      

      In maven 3, this doesn't happen, and a Grails 1.2.0 project is created instead, causing confusion.

      [INFO] Archetype repository missing. Using the one from [org.grails:grails-maven-archetype:1.2.0] found in catalog remote
      

      This single line output is easily overlooked.

      Adding -DarchetypeRepository=http://repo1.maven.org/maven2 does the trick in maven 3, but I expected maven central to be default enabled?

      One of the features of maven 3 is backward compatibility with maven 2. Is this change intentional?
      I think the command should fail when the explicit given version is not found, not just use an old version.
      And maven central should be used like in maven 2, to preserve backwards compatibility, and support 'principle of least surprise' as maven central is default enabled for other dependencies.

        Issue Links

          Activity

          Hide
          Herve Boutemy added a comment -

          I just had a look at the case and confirm this is a stupid bug: automatic catalog retrieval overrides version searched for...

          Show
          Herve Boutemy added a comment - I just had a look at the case and confirm this is a stupid bug: automatic catalog retrieval overrides version searched for...
          Hide
          Herve Boutemy added a comment -

          fixed in r1039970

          Show
          Herve Boutemy added a comment - fixed in r1039970

            People

            • Assignee:
              Herve Boutemy
              Reporter:
              Ronny Løvtangen
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: