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

Inadequate error diagnosis for archetype problems

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0-alpha-5
    • 2.0
    • Creator
    • None
    • JDK 6u21, Ubuntu, Maven 3.0 beta 3.
    • Patch

    Description

      See https://netbeans.org/bugzilla/show_bug.cgi?id=190033 for background. If you run the command listed there with a clean repository under Maven 3.0 beta 3, you get an error, but maven-archetype-plugin does not really help you track it down. Turns out there is a ZipException due to a *.jar file actually being an HTTP error message, but the closest you get is

      ...
      [DEBUG] Found archetype org.codehaus.mojo.archetypes:webapp-javaee6:1.1 in cache: ~/.m2/repository/org/codehaus/mojo/archetypes/webapp-javaee6/1.1/webapp-javaee6-1.1.jar
      [ERROR] Failed to close zipFile
      ...
      org.apache.maven.plugin.MojoFailureException: The defined artifact is not an archetype
          at org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.execute(CreateProjectFromArchetypeMojo.java:204)
          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      

      With the attached patch, you get more information:

      ...
      [DEBUG] checking archetype status on ~/.m2/repository/org/codehaus/mojo/archetypes/webapp-javaee6/1.1/webapp-javaee6-1.1.jar
      ...
      [DEBUG] failed
      org.apache.maven.archetype.exception.UnknownArchetype: java.util.zip.ZipException: error in opening zip file
      	at org.apache.maven.archetype.common.DefaultArchetypeArtifactManager.getArchetypeZipFile(DefaultArchetypeArtifactManager.java:172)
      	at org.apache.maven.archetype.common.DefaultArchetypeArtifactManager.isOldArchetype(DefaultArchetypeArtifactManager.java:263)
      	at org.apache.maven.archetype.ui.DefaultArchetypeGenerationConfigurator.configureArchetype(DefaultArchetypeGenerationConfigurator.java:142)
      	at org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.execute(CreateProjectFromArchetypeMojo.java:188)
      ...
      org.apache.maven.plugin.MojoFailureException: The defined artifact is not an archetype
      	at org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.execute(CreateProjectFromArchetypeMojo.java:204)
      	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      	... 19 more
      Caused by: org.apache.maven.archetype.exception.ArchetypeGenerationConfigurationFailure: The defined artifact is not an archetype
      	at org.apache.maven.archetype.ui.DefaultArchetypeGenerationConfigurator.configureArchetype(DefaultArchetypeGenerationConfigurator.java:154)
      	at org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.execute(CreateProjectFromArchetypeMojo.java:188)
      ...
      

      Attachments

        1. maven-archetype-plugin-diagnosis.diff
          3 kB
          Jesse N. Glick
        2. ARCHETYPE-327.diff
          0.7 kB
          Jesse N. Glick

        Activity

          People

            hboutemy Herve Boutemy
            jglick Jesse N. Glick
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: