mvn -DarchetypeVersion=1.7 -Darchetype.interactive=false -DgroupId=com.mycompany -DarchetypeArtifactId=netbeans-platform-app-archetype -DarchetypeRepository=http://repo1.maven.org/maven2/ -Dversion=1.0-SNAPSHOT -DarchetypeGroupId=org.codehaus.mojo.archetypes -DnetbeansVersion=RELEASE70-BETA -DartifactId=HelloWorld --batch-mode archetype:generate
You will see this:
[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] [archetype:generate {execution: default-cli}]
[INFO] Generating project in Batch mode
[INFO] Archetype defined by properties
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Fri Dec 31 12:02:06 CET 2010
[INFO] Final Memory: 13M/88M
And on disk you will have this, assuming the folder where you entered the above command is named "scratch":
I.e., you have a Maven reactor named "HelloWorld", containing a module for the NetBeans Platform application and a module for the branding resources in the application.
2. cd into the "HelloWorld" folder and then put this on the command line:
mvn --projects com.mycompany:application --also-make install
You will see this:
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO] HelloWorld - NB App Parent
[INFO] HelloWorld - NB App Branding
[INFO] HelloWorld - NB App
[INFO] ------------------------------------------------------------------------
[INFO] Building HelloWorld - NB App Parent
[INFO] task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [site:attach-descriptor {execution: default-attach-descriptor}]
[INFO] [install:install {execution: default-install}]
[INFO] Installing /home/geertjan/scratch/HelloWorld/pom.xml to /home/geertjan/.m2/repository/com/mycompany/HelloWorld/1.0-SNAPSHOT/HelloWorld-1.0-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] Building HelloWorld - NB App Branding
[INFO] task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] [compiler:compile {execution: default-compile}]
[INFO] No sources to compile
[INFO] [nbm:manifest {execution: default-manifest}]
[INFO] NBM Plugin generates manifest
[INFO] [resources:testResources {execution: default-testResources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/geertjan/scratch/HelloWorld/branding/src/test/resources
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] No sources to compile
[INFO] [surefire:test {execution: default-test}]
[INFO] No tests to run.
[INFO] [jar:jar {execution: default-jar}]
[INFO] Adding existing MANIFEST to archive. Found under: /home/geertjan/scratch/HelloWorld/branding/target/classes/META-INF/MANIFEST.MF
[INFO] Building jar: /home/geertjan/scratch/HelloWorld/branding/target/branding-1.0-SNAPSHOT.jar
[INFO] [nbm:branding {execution: default-branding}]
[INFO] Building jar: /home/geertjan/scratch/HelloWorld/branding/target/nbm/netbeans/helloworld/core/locale/core_helloworld.jar
[INFO] Building jar: /home/geertjan/scratch/HelloWorld/branding/target/nbm/netbeans/helloworld/modules/locale/org-netbeans-core_helloworld.jar
[INFO] Building jar: /home/geertjan/scratch/HelloWorld/branding/target/nbm/netbeans/helloworld/modules/locale/org-netbeans-core-windows_helloworld.jar
[INFO] [nbm:nbm {execution: default-nbm}]
[INFO] Copying module jar to /home/geertjan/scratch/HelloWorld/branding/target/nbm/netbeans/helloworld/modules
[INFO] [install:install {execution: default-install}]
[INFO] Installing /home/geertjan/scratch/HelloWorld/branding/target/branding-1.0-SNAPSHOT.jar to /home/geertjan/.m2/repository/com/mycompany/branding/1.0-SNAPSHOT/branding-1.0-SNAPSHOT.jar
[INFO] Installing /home/geertjan/scratch/HelloWorld/branding/target/branding-1.0-SNAPSHOT.nbm to /home/geertjan/.m2/repository/com/mycompany/branding/1.0-SNAPSHOT/branding-1.0-SNAPSHOT.nbm
[INFO] ------------------------------------------------------------------------
[INFO] Building HelloWorld - NB App
[INFO] task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] snapshot com.mycompany:branding:1.0-SNAPSHOT: checking for updates from netbeans
[INFO] [nbm:cluster-app {execution: default-cluster-app}]
[INFO] Processing cluster 'platform'
[INFO] Processing cluster 'helloworld'
[INFO] Created NetBeans module cluster(s) at /home/geertjan/scratch/HelloWorld/application/target/helloworld
[INFO] [resources:testResources {execution: default-testResources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/geertjan/scratch/HelloWorld/application/src/test/resources
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] No sources to compile
[INFO] [surefire:test {execution: default-test}]
[INFO] No tests to run.
[INFO] [nbm:standalone-zip {execution: default-standalone-zip}]
[INFO] Building zip: /home/geertjan/scratch/HelloWorld/application/target/application-1.0-SNAPSHOT.zip
[INFO] [install:install {execution: default-install}]
[INFO] Installing /home/geertjan/scratch/HelloWorld/application/target/application-1.0-SNAPSHOT.zip to /home/geertjan/.m2/repository/com/mycompany/application/1.0-SNAPSHOT/application-1.0-SNAPSHOT.zip
[INFO]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] ------------------------------------------------------------------------
[INFO] HelloWorld - NB App Parent ............................ SUCCESS [3.273s]
[INFO] HelloWorld - NB App Branding .......................... SUCCESS [4.513s]
[INFO] HelloWorld - NB App ................................... SUCCESS [9.017s]
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19 seconds
[INFO] Finished at: Fri Dec 31 12:07:40 CET 2010
[INFO] Final Memory: 23M/196M
[INFO] ------------------------------------------------------------------------
3. cd into your "application" folder and then put this on the command line:
mvn nbm:run-platform
You will see this:
Now go to the "Maven Integration" section on the NetBeans Platform Learning Trail to learn about how to take the next steps in creating your Java desktop application.