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 214006 - Maven - Create Project from Archetype: projectName property empty
Summary: Maven - Create Project from Archetype: projectName property empty
Status: VERIFIED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.1.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: Milos Kleint
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-11 18:27 UTC by agallardo
Modified: 2012-06-14 20:02 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Provided project name and location (45.35 KB, image/png)
2012-06-11 18:27 UTC, agallardo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description agallardo 2012-06-11 18:27:00 UTC
Created attachment 120688 [details]
Provided project name and location

When creating a new maven project from archetype, NB fails reporting the message: "Property projectName is missing. Add -DprojectName=someValue."

Environment
-----------

Product Version: NetBeans IDE 7.1.2 (Build 201204101705)
Java: 1.6.0_26; Java HotSpot(TM) 64-Bit Server VM 20.1-b02
System: Linux version 3.2.0-2-amd64 running on amd64; UTF-8; de_DE (nb)


Steps to reproduce
------------------

1. New project / Maven / Project from Archetype
   Add...
   Group Id: at.infonova.opencms.archetypes
   Artifact Id: opencms-module-archetype
   Version: 1.0.1
   Repository: http://bp-cms-commons.sourceforge.net

2. Select "Custom archetype - opencms-module-archetype (1.0.1)"

3. Click "Next >"

4. Fill-in new project name and location:
   Project Name: mavenproject2
   Project Location: /tmp/nb-bugs
   Group Id: com.mycompany
   Version: 1.0-SNAPSHOT
   Package: com.mycompany.mavenproject2
   Additional Creation Properties:
   Key: projectName
   Value: mymavenproject2

5. Click "Finish"

6. It fails with the above mentioned failure: "Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:generate (default-cli) on project standalone-pom: Archetype at.infonova.opencms.archetypes:opencms-module-archetype:1.0.1 is not configured
Property projectName is missing."

Notice that the generated command line is specifying "-DprojectName="


Output - Project Creation
-------------------------

cd /tmp/nb-bugs; JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.26/jre /home/alberto/usr/netbeans-7.1.2/java/maven/bin/mvn -DarchetypeGroupId=at.infonova.opencms.archetypes -DarchetypeArtifactId=opencms-module-archetype -DarchetypeVersion=1.0.1 -DarchetypeRepository=http://bp-cms-commons.sourceforge.net -DgroupId=com.mycompany -DartifactId=mavenproject2 -Dversion=1.0-SNAPSHOT -Dpackage=com.mycompany.mavenproject2 -Dbasedir=/tmp/nb-bugs -DprojectName= -Darchetype.interactive=false --batch-mode archetype:generate
Scanning for projects...
                                                                        
------------------------------------------------------------------------
Building Maven Stub Project (No POM) 1
------------------------------------------------------------------------

>>> maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom >>>

<<< maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom <<<

[archetype:generate]
Generating project in Batch mode
Archetype defined by properties
Property projectName is missing. Add -DprojectName=someValue
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 3.064s
Finished at: Mon Jun 11 20:20:25 CEST 2012
Final Memory: 8M/71M
------------------------------------------------------------------------
Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:generate (default-cli) on project standalone-pom: Archetype at.infonova.opencms.archetypes:opencms-module-archetype:1.0.1 is not configured
Property projectName is missing.
-> [Help 1]
Comment 1 agallardo 2012-06-11 18:31:22 UTC
The creation of this example project works running maven from the command line providing the "-DprojectName=mymavenproject2":


/tmp$ mvn -DarchetypeGroupId=at.infonova.opencms.archetypes -DarchetypeArtifactId=opencms-module-archetype -DarchetypeVersion=1.0.1 -DarchetypeRepository=http://bp-cms-commons.sourceforge.net -DgroupId=com.mycompany -DartifactId=mavenproject2 -Dversion=1.0-SNAPSHOT -Dpackage=com.mycompany.mavenproject2 -Dbasedir=/tmp/nb-bugs -DprojectName=mymavenproject2 -Darchetype.interactive=false --batch-mode archetype:generate
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=lcd
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom >>>
[INFO] 
[INFO] <<< maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom <<<
[INFO] 
[INFO] --- maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Batch mode
[INFO] Archetype defined by properties
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: opencms-module-archetype:1.0.1
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: com.mycompany
[INFO] Parameter: artifactId, Value: mavenproject2
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: com.mycompany.mavenproject2
[INFO] Parameter: packageInPathFormat, Value: com/mycompany/mavenproject2
[INFO] Parameter: package, Value: com.mycompany.mavenproject2
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: projectName, Value: mymavenproject2
[INFO] Parameter: groupId, Value: com.mycompany
[INFO] Parameter: artifactId, Value: mavenproject2
[INFO] project created from Archetype in dir: /tmp/mavenproject2
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.936s
[INFO] Finished at: Mon Jun 11 20:30:28 CEST 2012
[INFO] Final Memory: 9M/72M
[INFO] ------------------------------------------------------------------------
Comment 2 Milos Kleint 2012-06-12 10:55:15 UTC
https://hg.netbeans.org/core-main/rev/8833f723eb2f
Comment 3 Quality Engineering 2012-06-14 06:08:58 UTC
Integrated into 'main-golden', will be available in build *201206140001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/8833f723eb2f
User: Milos Kleint <mkleint@netbeans.org>
Log: #214006 need to update enable button on edit and have table cell changes applied when finish is clicked
Comment 4 agallardo 2012-06-14 19:52:38 UTC
Verified that it is fixed. Thanks!

Downloaded, built and tested: NetBeans IDE Dev (Build 20120614-19b7747c2923)

Am I supposed to close it?
Comment 5 Jesse Glick 2012-06-14 20:02:19 UTC
Use status=VERIFIED.