This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 190033 - Cannot create NBM projects (bad redirect)
Summary: Cannot create NBM projects (bad redirect)
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.0
Hardware: All All
: P1 normal (vote)
Assignee: Jesse Glick
URL:
Keywords: REGRESSION
: 189940 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-08-31 15:30 UTC by Martin Schovanek
Modified: 2010-09-24 17:27 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Schovanek 2010-08-31 15:30:19 UTC
[#2010083100001, jdk1.6]

to reproduce:
-------------
1) create a new: Maven Web Application project
ERROR: IDE fails with:

JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home "/Applications/NetBeans/NetBeans Dev 201008310001.app/Contents/Resources/NetBeans/java/maven/bin/mvn" -DarchetypeVersion=1.1 -Darchetype.interactive=false -DgroupId=com.mycompany -DarchetypeArtifactId=webapp-javaee6 -DarchetypeRepository=http://repository.codehaus.org -Dversion=1.0-SNAPSHOT -DarchetypeGroupId=org.codehaus.mojo.archetypes -Darchetype.repository=http://repository.codehaus.org -Dbasedir=/Users/ms113234/NetBeansProjects -Dpackage=com.mycompany.mavenproject19 -DartifactId=mavenproject19 -Dnetbeans.execution=true --batch-mode org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-4:generate
Scanning for projects...
                                                                        
------------------------------------------------------------------------
Building Maven Stub Project (No POM) 1
------------------------------------------------------------------------

>>> maven-archetype-plugin:2.0-alpha-4:generate (default-cli) @ standalone-pom >>>

<<< maven-archetype-plugin:2.0-alpha-4:generate (default-cli) @ standalone-pom <<<

--- maven-archetype-plugin:2.0-alpha-4:generate (default-cli) @ standalone-pom ---
Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
Setting property: velocimacro.messages.on => 'false'.
Setting property: resource.loader => 'classpath'.
Setting property: resource.manager.logwhenfound => 'false'.
Generating project in Batch mode
Archetype defined by properties
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 1.760s
Finished at: Tue Aug 31 17:24:09 CEST 2010
Final Memory: 6M/81M
------------------------------------------------------------------------
Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-4:generate (default-cli) on project standalone-pom: The defined artifact is not an archetype -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Comment 1 Petr Jiricka 2010-09-02 15:06:48 UTC
I can not reproduce with the latest continuous build. Martin, can you still reproduce?
Comment 2 Martin Schovanek 2010-09-03 06:42:31 UTC
Reproducible on #201009020000, with fresh userdir and Maven repository (${usrdir/.m2}).
Comment 3 Petr Jiricka 2010-09-06 12:27:54 UTC
You are right, with fresh Maven repository it is reproducible. Although I am getting a different error:

Generating project in Batch mode
Archetype defined by properties
*** CHECKSUM FAILED - Checksum failed on download: local = '9f8629fad916b496eb77ea70c0e35976a27a56e3'; remote = '<!DOCTYPE' - RETRYING
*** CHECKSUM FAILED - Checksum failed on download: local = '9f8629fad916b496eb77ea70c0e35976a27a56e3'; remote = '<!DOCTYPE' - IGNORING
------------------------------------------------------------------------
BUILD FAILURE

I see the archetype was not downloaded correctly - the size of webapp-javaee6-1.1.jar on the disk is 425 bytes, when it should be >4 KB.
Comment 4 Antonin Nebuzelsky 2010-09-14 10:27:48 UTC
Version 1.1 of webapp-javaee6 archetype is simply broken. This version was introduced on June/30 as a fix for issue 181861 and issue 186223.

I see a difference between 1.0.2 (as used by 6.9.1) and 1.1 in archetype-metadata.xml file. Version 1.1 includes the following additional data in the archetype-descriptor element:

<archetype-descriptor xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd"
  partial="false" name="JavaEE6 web application archetype">

while 1.0.2 contained only

<archetype-descriptor id="webapp-javaee6" partial="false" name="JavaEE6 web application archetype">

It needs to be fixed in the archetype, new version released and the reference updated in

maven/src/org/netbeans/modules/maven/newproject/ArchetypeWizardUtils.java
Comment 5 Antonin Nebuzelsky 2010-09-14 10:38:25 UTC
The same applies to 1.1 versions of archetypes:

webapp-javaee6
ejb-javaee6
ear-javaee6
ear-jee5
ear-j2ee14

BTW, the archetypes can be browsed online at
https://nexus.codehaus.org/content/repositories/releases/org/codehaus/mojo/archetypes/
Comment 6 Antonin Nebuzelsky 2010-09-14 10:48:45 UTC
See also http://jira.codehaus.org/browse/MARCHETYPES-36
Comment 7 Jesse Glick 2010-09-16 22:42:01 UTC
The archetypes are fine; the problem is in Maven: http://jira.codehaus.org/browse/MNG-4816

http://jira.codehaus.org/browse/ARCHETYPE-327 is also relevant for diagnosis.
Comment 8 Jesse Glick 2010-09-16 22:55:52 UTC
core-main #8891f03ceb92
Comment 9 Quality Engineering 2010-09-18 03:43:16 UTC
Integrated into 'main-golden', will be available in build *201009180000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/8891f03ceb92
User: Jesse Glick <jglick@netbeans.org>
Log: #190033: M3 cannot handle 301 server redirects.
Comment 10 Jesse Glick 2010-09-20 17:17:54 UTC
Seems it is still a problem for http://snapshots.repository.codehaus.org/org/codehaus/mojo/archetypes/nbm-archetype/1.3-SNAPSHOT/maven-metadata.xml which now redirects to a 404, i.e. content does not appear anywhere so there is no known workaround.
Comment 11 Jesse Glick 2010-09-20 17:21:38 UTC
One workaround would be to publish snapshot versions of archetypes we rely on to http://bits.netbeans.org/maven2/ so we can be sure they remain available. I do not have physical authority to do this, however.
Comment 12 Jesse Glick 2010-09-20 17:47:40 UTC
Hmm, turns out there were already newer release versions of these archetypes published on central... dsimonek had just neglected to tell the IDE to use them. core-main #25b189e6d3ba
Comment 13 Jesse Glick 2010-09-20 22:47:02 UTC
*** Bug 189940 has been marked as a duplicate of this bug. ***
Comment 14 Antonin Nebuzelsky 2010-09-21 15:42:07 UTC
With the fixes I was still receiving the same error ("The defined artifact is not an archetype") when trying to create e.g. a Maven Web Application project.

If this happens to someone, they need to remove the archetypes from their local maven repo before trying again:

   rm -rf ~/.m2/repository/org/codehaus/mojo/archetypes
Comment 15 Quality Engineering 2010-09-22 03:09:50 UTC
Integrated into 'main-golden', will be available in build *201009220000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/25b189e6d3ba
User: Jesse Glick <jglick@netbeans.org>
Log: #190033 cont'd: no need to use broken snapshot repo when newer releases available anyway!
Comment 16 Jesse Glick 2010-09-24 17:27:31 UTC
(In reply to comment #7)
> The archetypes are fine; the problem is in Maven:
> http://jira.codehaus.org/browse/MNG-4816

More up to date:

http://jira.codehaus.org/browse/MNG-4838
http://jira.codehaus.org/browse/WAGON-314