You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Jesse Glick (JIRA)" <ji...@codehaus.org> on 2010/09/17 00:34:33 UTC

[jira] Created: (ARCHETYPE-327) Inadequate error diagnosis for archetype problems

Inadequate error diagnosis for archetype problems
-------------------------------------------------

                 Key: ARCHETYPE-327
                 URL: http://jira.codehaus.org/browse/ARCHETYPE-327
             Project: Maven Archetype
          Issue Type: Bug
          Components: Creator
    Affects Versions: 2.0-alpha-5
         Environment: JDK 6u21, Ubuntu, Maven 3.0 beta 3.
            Reporter: Jesse Glick
            Priority: Minor
         Attachments: maven-archetype-plugin-diagnosis.diff

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

{code}
...
[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)
{code}

With the attached patch, you get more information:

{code}
...
[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)
...
{code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (ARCHETYPE-327) Inadequate error diagnosis for archetype problems

Posted by "Jesse Glick (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/ARCHETYPE-327?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jesse Glick updated ARCHETYPE-327:
----------------------------------

    Attachment: ARCHETYPE-327.diff

It compiled when I submitted it, if you include the POM change (MNG-3279) but I could use initCause instead. Seems various things changed in SVN since then so I have recreated the patch.

Difficult to reproduce original problem since someone cleaned up http://repository.codehaus.org/org/codehaus/mojo/ so that the HTTP redirect bug is no longer manifested. However this seems to demonstrate the lack of a full stack trace without the patch:

{noformat}
$ mvn -DarchetypeGroupId=bogus -DarchetypeArtifactId=bogus -DarchetypeVersion=1.0 -DgroupId=test -DartifactId=test-ARCHETYPE-327 --errors org.apache.maven.plugins:maven-archetype-plugin:2.0-SNAPSHOT:generate
...
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoFailureException: The desired archetype does not exist (bogus:bogus:1.0)
    at org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.execute(CreateProjectFromArchetypeMojo.java:205)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:195)
    ... 19 more
...
{noformat}

and with the patch:

{noformat}
...
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoFailureException: The desired archetype does not exist (bogus:bogus:1.0)
    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:195)
    ... 19 more
Caused by: org.apache.maven.archetype.exception.UnknownArchetype: The desired archetype does not exist (bogus:bogus:1.0)
    at org.apache.maven.archetype.ui.DefaultArchetypeGenerationConfigurator.configureArchetype(DefaultArchetypeGenerationConfigurator.java:124)
    at org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.execute(CreateProjectFromArchetypeMojo.java:188)
    ... 21 more
...
{noformat}

which is more likely to be useful.

> Inadequate error diagnosis for archetype problems
> -------------------------------------------------
>
>                 Key: ARCHETYPE-327
>                 URL: http://jira.codehaus.org/browse/ARCHETYPE-327
>             Project: Maven Archetype
>          Issue Type: Bug
>          Components: Creator
>    Affects Versions: 2.0-alpha-5
>         Environment: JDK 6u21, Ubuntu, Maven 3.0 beta 3.
>            Reporter: Jesse Glick
>            Priority: Minor
>             Fix For: 2.0
>
>         Attachments: ARCHETYPE-327.diff, maven-archetype-plugin-diagnosis.diff
>
>
> 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
> {code}
> ...
> [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)
> {code}
> With the attached patch, you get more information:
> {code}
> ...
> [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)
> ...
> {code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (ARCHETYPE-327) Inadequate error diagnosis for archetype problems

Posted by "Herve Boutemy (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/ARCHETYPE-327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=236449#action_236449 ] 

Herve Boutemy commented on ARCHETYPE-327:
-----------------------------------------

your patch on CreateProjectFromArchetypeMojo doesn't compile (MojoFailureException(Exception, String) constructor does not exist)

the other parts of your patch seem partially redundant with actual code, which already taces some failures

can you check if you can provide a unit test?

> Inadequate error diagnosis for archetype problems
> -------------------------------------------------
>
>                 Key: ARCHETYPE-327
>                 URL: http://jira.codehaus.org/browse/ARCHETYPE-327
>             Project: Maven Archetype
>          Issue Type: Bug
>          Components: Creator
>    Affects Versions: 2.0-alpha-5
>         Environment: JDK 6u21, Ubuntu, Maven 3.0 beta 3.
>            Reporter: Jesse Glick
>            Priority: Minor
>             Fix For: 2.0
>
>         Attachments: maven-archetype-plugin-diagnosis.diff
>
>
> 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
> {code}
> ...
> [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)
> {code}
> With the attached patch, you get more information:
> {code}
> ...
> [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)
> ...
> {code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (ARCHETYPE-327) Inadequate error diagnosis for archetype problems

Posted by "Herve Boutemy (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/ARCHETYPE-327?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Herve Boutemy updated ARCHETYPE-327:
------------------------------------

    Fix Version/s: 2.0

> Inadequate error diagnosis for archetype problems
> -------------------------------------------------
>
>                 Key: ARCHETYPE-327
>                 URL: http://jira.codehaus.org/browse/ARCHETYPE-327
>             Project: Maven Archetype
>          Issue Type: Bug
>          Components: Creator
>    Affects Versions: 2.0-alpha-5
>         Environment: JDK 6u21, Ubuntu, Maven 3.0 beta 3.
>            Reporter: Jesse Glick
>            Priority: Minor
>             Fix For: 2.0
>
>         Attachments: maven-archetype-plugin-diagnosis.diff
>
>
> 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
> {code}
> ...
> [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)
> {code}
> With the attached patch, you get more information:
> {code}
> ...
> [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)
> ...
> {code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (ARCHETYPE-327) Inadequate error diagnosis for archetype problems

Posted by "Herve Boutemy (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/ARCHETYPE-327?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Herve Boutemy closed ARCHETYPE-327.
-----------------------------------

    Resolution: Fixed
      Assignee: Herve Boutemy

patch applied in r1003942
thank you

> Inadequate error diagnosis for archetype problems
> -------------------------------------------------
>
>                 Key: ARCHETYPE-327
>                 URL: http://jira.codehaus.org/browse/ARCHETYPE-327
>             Project: Maven Archetype
>          Issue Type: Bug
>          Components: Creator
>    Affects Versions: 2.0-alpha-5
>         Environment: JDK 6u21, Ubuntu, Maven 3.0 beta 3.
>            Reporter: Jesse Glick
>            Assignee: Herve Boutemy
>            Priority: Minor
>             Fix For: 2.0
>
>         Attachments: ARCHETYPE-327.diff, maven-archetype-plugin-diagnosis.diff
>
>
> 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
> {code}
> ...
> [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)
> {code}
> With the attached patch, you get more information:
> {code}
> ...
> [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)
> ...
> {code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira