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

mvn archetype:generate is failing to download needed archetype artifacts

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 2.0-alpha-2
    • 2.0-alpha-3
    • Archetypes
    • None
    • Windows XP, Maven 2.0.9

    Description

      A fresh install of Maven 2.0.9 on Windows XP, if I issue this command:

      mvn archetype:generate -DarchetypeArtifactId=maven-archetype-quickstart

      I get this error message:
      [INFO] The desired archetype does not exist (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)

      Partial error stack:
      [INFO] Scanning for projects...
      [INFO] Searching repository for plugin with prefix: 'archetype'.
      [INFO] ------------------------------------------------------------------------
      [INFO] Building Maven Default Project
      [INFO] task-segment: [archetype:generate] (aggregator-style)
      [INFO] ------------------------------------------------------------------------
      [INFO] Preparing archetype:generate
      [INFO] No goals needed for project - skipping
      [INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus
      .velocity.ContextClassLoaderResourceLoader'.
      [INFO] Setting property: velocimacro.messages.on => 'false'.
      [INFO] Setting property: resource.loader => 'classpath'.
      [INFO] Setting property: resource.manager.logwhenfound => 'false'.
      [INFO] [archetype:generate]
      org.apache.maven.archetype.downloader.DownloadNotFoundException: Requested downl
      oad does not exist.
      at org.apache.maven.archetype.downloader.DefaultDownloader.download(Defa
      ultDownloader.java:62)
      at org.apache.maven.archetype.common.DefaultArchetypeArtifactManager.exi
      sts(DefaultArchetypeArtifactManager.java:310)
      at org.apache.maven.archetype.ui.DefaultArchetypeGenerationConfigurator.
      configureArchetype(DefaultArchetypeGenerationConfigurator.java:103)

      The same error also happens with an archetype artifact ID of "maven-archetype-webapp" (and probably all the others as well).

      However, if I issue the same command but using archetype:create instead of :generate, not only will the archetype artifact correctly download (and the command work successfully), subsequent usages of archetype:generate with that same archetype artifact will also correctly run.

      So I think the problem is that mvn archetype:generate needs to download archetype artifacts just like mvn archetype:create does.

      Attachments

        1. ARCHETYPE-159-3.patch
          5 kB
          Arnaud Heritier

        Activity

          People

            Unassigned Unassigned
            gmazza Glen Mazza
            Votes:
            7 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: