You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by oc...@apache.org on 2006/07/31 08:27:01 UTC

svn commit: r427028 - in /maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src: main/java/org/apache/maven/plugin/archetype/ site/apt/ site/apt/examples/

Author: oching
Date: Sun Jul 30 23:27:01 2006
New Revision: 427028

URL: http://svn.apache.org/viewvc?rev=427028&view=rev
Log:
PR: ARCHETYPE-45
Submitted by: Franz Allan See

Updated the plugin docs.

Modified:
    maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/main/java/org/apache/maven/plugin/archetype/CreateArchetypeFromProjectMojo.java
    maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/main/java/org/apache/maven/plugin/archetype/MavenArchetypeMojo.java
    maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/archetype.apt
    maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/j2ee-simple.apt
    maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/mojo.apt
    maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/portlet.apt
    maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/remote-repositories.apt
    maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/simple.apt
    maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/site.apt
    maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/webapp.apt
    maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/index.apt
    maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/usage.apt

Modified: maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/main/java/org/apache/maven/plugin/archetype/CreateArchetypeFromProjectMojo.java
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/main/java/org/apache/maven/plugin/archetype/CreateArchetypeFromProjectMojo.java?rev=427028&r1=427027&r2=427028&view=diff
==============================================================================
--- maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/main/java/org/apache/maven/plugin/archetype/CreateArchetypeFromProjectMojo.java (original)
+++ maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/main/java/org/apache/maven/plugin/archetype/CreateArchetypeFromProjectMojo.java Sun Jul 30 23:27:01 2006
@@ -27,8 +27,8 @@
 import java.io.FileInputStream;
 
 /**
- * Builds archetype containers based from an existing Maven project (work in
- * progress).
+ * Builds archetype containers based from an existing Maven project (currently
+ * under development).
  *
  * @goal create-from-project
  * @description Create an archetype from an existing Maven project.

Modified: maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/main/java/org/apache/maven/plugin/archetype/MavenArchetypeMojo.java
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/main/java/org/apache/maven/plugin/archetype/MavenArchetypeMojo.java?rev=427028&r1=427027&r2=427028&view=diff
==============================================================================
--- maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/main/java/org/apache/maven/plugin/archetype/MavenArchetypeMojo.java (original)
+++ maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/main/java/org/apache/maven/plugin/archetype/MavenArchetypeMojo.java Sun Jul 30 23:27:01 2006
@@ -35,9 +35,10 @@
 import java.util.Map;
 
 /**
- * The archetype creation goal looks for an archetype with a given groupId, artifactId, and
- * version and retrieves it from the remote repository. Once the archetype is retrieve it is process against
- * a set of user parameters to create a working Maven project.
+ * The archetype creation goal looks for an archetype with a given groupId, 
+ * artifactId, and version and retrieves it from the remote repository. Once the
+ * archetype is retrieved, it is then processed against a set of user parameters
+ * to create a working Maven project.
  *
  * @description Creates archetype containers.
  * @requiresProject false

Modified: maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/archetype.apt
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/archetype.apt?rev=427028&r1=427027&r2=427028&view=diff
==============================================================================
--- maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/archetype.apt (original)
+++ maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/archetype.apt Sun Jul 30 23:27:01 2006
@@ -3,23 +3,27 @@
  ------
  Jason van Zyl, Alexander Hars, Franz Allan Valencia See
  ------
- 26 October 2005
+ 25 July 2006
  ------
 
 Guide to Creating Archetypes
 
- Creating an archetype is a pretty straight forward process. An archetype is a very simple plugin, that 
- contains the project prototype you wish to create. An archetype is made up of: 
+ Creating an archetype is a pretty straight forward process. An archetype is a 
+ very simple plugin, that contains the project prototype you wish to create. 
+ An archetype is made up of: 
  
- * an archetype descriptor (<archetype.xml> in directory: <src/main/resources/META-INF/>). It lists all the files 
-   that will be contained in the archetype and categorizes them so they can be processed correctly by the 
-   archetype generation mechanism.
+ * an archetype descriptor (<<<archetype.xml>>> in directory: 
+   <<<src/main/resources/META-INF/>>>). It lists all the files that will be 
+   contained in the archetype and categorizes them so they can be processed 
+   correctly by the archetype generation mechanism.
 
- * the prototype files that are copied by the archetype (directory: <src/main/resources/archetype-resources/>)
+ * the prototype files that are copied by the archetype (directory: 
+   <<<src/main/resources/archetype-resources/>>>)
 
- * the prototpye pom (<pom.xml> in: <src/main/resources/archetype-resources>)
+ * the prototpye pom (<<<pom.xml>>> in: 
+   <<<src/main/resources/archetype-resources>>>)
 
- * a pom for the archetype (<pom.xml> in the archetype's root directory).
+ * a pom for the archetype (<<<pom.xml>>> in the archetype's root directory).
 
  [] 
 
@@ -27,7 +31,7 @@
 
 * 1. Create a new project and pom.xml for the archetype plugin
 
-  An example <pom.xml> for an archetype plugin looks as follows: 
+  An example <<<pom.xml>>> for an archetype plugin looks as follows: 
  
 +----+ 
 
@@ -41,13 +45,15 @@
 
 +----+ 
 
-  All you need to specify is a <groupId>, <artifactId> and <version>. These three parameters will be needed later for 
-  invoking the archetype via <archetype:create> from the commandline.  
+  All you need to specify is a <<<groupId>>>, <<<artifactId>>> and 
+  <<<version>>>. These three parameters will be needed later for invoking the 
+  archetype via <<<archetype:create>>> from the commandline.  
 
 * 2. Create the archetype descriptor
 
- The archetype descriptor is a file called <archetype.xml> which must be located in <src/main/resources/META-INF/>
- An example for an archetype descriptor can be found in the quickstart archetype: 
+ The archetype descriptor is a file called <<<archetype.xml>>> which must be 
+ located in <<<src/main/resources/META-INF/>>> An example for an archetype 
+ descriptor can be found in the quickstart archetype: 
 
 +----+
 
@@ -63,33 +69,41 @@
 
 +----+
 
- The \<id\> tag should be the same as the artifactId in the archetype <pom.xml>. 
+ The <<<\<id\>>>> tag should be the same as the <<<artifactId>>> in the 
+ archetype <<<pom.xml>>>. 
 
- An optional \<allowPartial\>true\</allowPartial\> tag makes it possible to run the archetype:create even on existing projects. 
+ An optional <<<\<allowPartial\>true\</allowPartial\>>>> tag makes it possible 
+ to run the <<<archetype:create>>> even on existing projects. 
 
- The \<sources\>, \<resources\>, \<test-resources\> and \<site-resources\> tags represent the different sections of the project: 
+ The <<<\<sources\>>>>, <<<\<resources\>>>>, <<<\<test-resources\>>>> and 
+ <<<\<site-resources\>>>> tags represent the different sections of the project: 
 
- * \<sources\> = src/main/java
+ * <<<\<sources\>>>> = <<<src/main/java>>>
 
- * \<resources\> = src/main/resources
+ * <<<\<resources\>>>> = <<<src/main/resources>>>
 
- * \<test-sources\> = src/test/java
+ * <<<\<test-sources\>>>> = <<<src/test/java>>>
 
- * \<test-resources\> = src/test/resources
+ * <<<\<test-resources\>>>> = <<<src/test/resources>>>
 
- * \<site-resources\> = src/site 
+ * <<<\<site-resources\>>>> = <<<src/site>>> 
 
  []
 
- \<sources\> and \<test-sources\> can contain \<source\> elements that specify a source file. 
+ <<<\<sources\>>>> and <<<\<test-sources\>>>> can contain <<<\<source\>>>> 
+ elements that specify a source file. 
 
- \<test-resources\> and \<site-resources\> can contain \<resource\> elements that specify a resource file. 
+ <<<\<test-resources\>>>> and <<<\<site-resources\>>>> can contain 
+ <<<\<resource\>>>> elements that specify a resource file. 
 
- Place other resources such as the ones in the <<<src/main/webapp>>> directory inside the \<resources\> tag.
+ Place other resources such as the ones in the <<<src/main/webapp>>> directory 
+ inside the <<<\<resources\>>>> tag.
 
- At this point one can only specify individual files to be created but not empty directories. 
+ At this point one can only specify individual files to be created but not empty
+ directories. 
 
- Thus the quickstart archetype shown above defines the following directory structure: 
+ Thus the quickstart archetype shown above defines the following directory 
+ structure: 
 
 +----+
 
@@ -114,11 +128,13 @@
 
 * 3. Create the prototype files and the prototype pom.xml
 
- The next component of the archetype to be created is the prototype <pom.xml>. Any <pom.xml> will do, just 
- don't forget to the set <artifactId> and <groupId> as variables  ( <$\{artifactId\}> / <$\{groupId\}> ). Both variables 
- will be initialized from the commandline when calling <archetype:create>.   
+ The next component of the archetype to be created is the prototype 
+ <<<pom.xml>>>. Any <<<pom.xml>>> will do, just don't forget to the set 
+ <<<artifactId>>> and <<<groupId>>> as variables  ( <<<$\{artifactId\}>>> / 
+ <<<$\{groupId\}>>> ). Both variables will be initialized from the commandline 
+ when calling <<<archetype:create>>>.   
 
- An example for a prototype <pom.xml> is: 
+ An example for a prototype <<<pom.xml>>> is: 
 
 +----+
 
@@ -152,20 +168,29 @@
 
 +----+
 
- Now that you have created an archetype you can try it on your local system by using the following command:
- In this command, you need to specify the full information about the archetype you want to use (its groupId, its artifactId, its version) and the information about the new project you want to create (artifactId and groupId). 
- Don't forget to include the version of your archetype (if you don't include the version, you archetype creation may fail with a message that version:RELEASE was not found) 
+ Now that you have created an archetype you can try it on your local system by 
+ using the following command. In this command, you need to specify the full 
+ information about the archetype you want to use (its <<<groupId>>>, its 
+ <<<artifactId>>>, its <<<version>>>) and the information about the new project 
+ you want to create (<<<artifactId>>> and <<<groupId>>>). Don't forget to 
+ include the version of your archetype (if you don't include the version, you 
+ archetype creation may fail with a message that version:RELEASE was not found) 
 
 
 +----+
 
-mvn archetype:create -DarchetypeGroupId=<archetype-groupId> -DarchetypeArtifactId=<archetype-artifactId> \ 
-  -DarchetypeVersion=<archetype-version> -DgroupId=<my.groupid> -DartifactId=<my-artifactId>
+mvn archetype:create                                    \
+  -DarchetypeGroupId=<archetype-groupId>                \
+  -DarchetypeArtifactId=<archetype-artifactId>          \ 
+  -DarchetypeVersion=<archetype-version>                \
+  -DgroupId=<my.groupid>                                \
+  -DartifactId=<my-artifactId>   
 
 +----+
 
- Once you are happy with the state of your archetype you can deploy (or submit it to ibiblio) it as any other artifact and
- the archetype will then be available to any user of Maven.
+ Once you are happy with the state of your archetype you can deploy (or submit 
+ it to ibiblio) it as any other artifact and the archetype will then be 
+ available to any user of Maven.
  
 * Alternative way to start creating your Archetype
  
@@ -179,6 +204,6 @@
   -DarchetypeArtifactId=maven-archetype-archetype
 +------+
 
- Afterwhich, you can now customize the contents of the archetyep-resources 
- directory, and archetype.xml, then, proceed to Step#4 (Install and run the 
- archetype).
+ Afterwhich, you can now customize the contents of the <<<archetype-resources>>>
+ directory, and <<<archetype.xml>>>, then, proceed to Step#4 (Install and run 
+ the archetype plugin).

Modified: maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/j2ee-simple.apt
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/j2ee-simple.apt?rev=427028&r1=427027&r2=427028&view=diff
==============================================================================
--- maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/j2ee-simple.apt (original)
+++ maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/j2ee-simple.apt Sun Jul 30 23:27:01 2006
@@ -9,8 +9,8 @@
 Creating a simple j2ee Project
  
  Creating the directory structure of a J2EE project can be tedious. However, if
- you would use maven-archetype-j2ee-simple, the usual directories for a j2ee 
- project would be provided for you.
+ you would use <<<maven-archetype-j2ee-simple>>>, the usual directories for a 
+ j2ee project would be provided for you.
  
 +------+
 mvn archetype:create 
@@ -19,7 +19,7 @@
   -DarchetypeArtifactId=maven-archetype-j2ee-simple
 +------+
 
- This would then create a maven proect.
+ This would then create a maven project.
 
 +------+
 .

Modified: maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/mojo.apt
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/mojo.apt?rev=427028&r1=427027&r2=427028&view=diff
==============================================================================
--- maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/mojo.apt (original)
+++ maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/mojo.apt Sun Jul 30 23:27:01 2006
@@ -9,7 +9,7 @@
 Creating a mojo
  
  A maven plugin is composed of one or more mojos. And to start the creation of
- a maven plugin, you can ues maven-archetype-mojo to create a mojo.
+ a maven plugin, you can use <<<maven-archetype-mojo>>> to create a mojo.
  
 +------+
 mvn archetype:create 
@@ -18,7 +18,7 @@
   -DarchetypeArtifactId=maven-archetype-mojo
 +------+
 
- This would then create a maven proect.
+ This would then create a maven project.
 
 +------+
 .

Modified: maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/portlet.apt
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/portlet.apt?rev=427028&r1=427027&r2=427028&view=diff
==============================================================================
--- maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/portlet.apt (original)
+++ maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/portlet.apt Sun Jul 30 23:27:01 2006
@@ -8,8 +8,8 @@
  
 Creating a portlet
  
- Use maven-archetype-webapp to start a simple webapp maven project. The command
- is as follows"
+ Use <<<maven-archetype-webapp>>> to start a simple webapp maven project. The 
+ command is as follows
  
 +------+
 mvn archetype:create 
@@ -18,7 +18,7 @@
   -DarchetypeArtifactId=maven-archetype-portlet
 +------+
 
- This would then create a maven proect.
+ This would then create a maven project.
 
 +------+
 .

Modified: maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/remote-repositories.apt
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/remote-repositories.apt?rev=427028&r1=427027&r2=427028&view=diff
==============================================================================
--- maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/remote-repositories.apt (original)
+++ maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/remote-repositories.apt Sun Jul 30 23:27:01 2006
@@ -9,8 +9,8 @@
 
 Specifying the Remote Repositories
 
- To use an archetype found in a remote repository, use the remoteRepositories 
- -D expression. 
+ To use an archetype found in a remote repository, use the 
+ <<<remoteRepositories>>> property / parameter. 
  
 +------+
 mvn archetype:create 
@@ -22,9 +22,11 @@
   -DremoteRepositories=[urls of your remote repositories]
 +------+
 
- For example, if you want to use a remote.archetype.gid:remote-archetype-aid:1.0
- to create a your.proj.gid:your-proj-aid project and that archetype is located
- at http://remote.archetypes.url, then your maven command would be
+ For example, if you want to use a 
+ <<<remote.archetype.gid:remote-archetype-aid:1.0>>>
+ to create a <<<your.proj.gid:your-proj-aid project>>> and that archetype 
+ is located at <<<http://remote.archetypes.url>>>, then your maven command 
+ would be
  
 +------+
 mvn archetype:create                                                    \

Modified: maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/simple.apt
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/simple.apt?rev=427028&r1=427027&r2=427028&view=diff
==============================================================================
--- maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/simple.apt (original)
+++ maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/simple.apt Sun Jul 30 23:27:01 2006
@@ -8,16 +8,26 @@
  
 Creating a simple java application
  
- To start of with your java project, you can use maven-archetype-quickstart.
- Simply, you'd just have to provide a groupId and an artifactId (at the least).
+ To start of with your java project, you can use 
+ <<<maven-archetype-quickstart.>>> Simply, you'd just have to provide a 
+ <<<groupId>>> and an <<<artifactId>>> (at the least).
  
 +------+
 mvn archetype:create 
   -DgroupId=[your project's group id]
   -DartifactId=[your project's artifact id]
+  -DarchetypeArtifactId=maven-archetype-quickstart
 +------+
 
- This would then create a maven proect.
+ or simply,
+
++------+
+mvn archetype:create 
+  -DgroupId=[your project's group id]
+  -DartifactId=[your project's artifact id]
++------+
+
+ This would then create a maven project.
 
 +------+
 .

Modified: maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/site.apt
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/site.apt?rev=427028&r1=427027&r2=427028&view=diff
==============================================================================
--- maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/site.apt (original)
+++ maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/site.apt Sun Jul 30 23:27:01 2006
@@ -8,11 +8,11 @@
  
 Creating a site
  
- You can create a site either by using maven-archetype-site-simple or 
- maven-archetype-site. You just need to set your maven project's groupId and 
- artifactId.
+ You can create a site either by using <<<maven-archetype-site-simple>>> or 
+ <<<maven-archetype-site>>>. You just need to set your maven project's 
+ <<<groupId>>> and <<<artifactId>>>.
  
- To jump start a simple site, choose maven-archetype-site-simple, 
+ To jump start a simple site, choose <<<maven-archetype-site-simple>>>, 
  
 +------+
 mvn archetype:create 
@@ -21,7 +21,7 @@
   -DarchetypeArtifactId=maven-archetype-site-simple
 +------+ 
 
- and it will generate a maven projecct with the following contents.
+ and it will generate a maven project with the following contents.
  
 +------+
 .
@@ -34,7 +34,12 @@
   `-- pom.xml
 +------+ 
 
- But to create a more complete version of a site, use maven-archetype-site.
+ The <<<index.apt>>> produced is of "Almost Plain Text" format which is used
+ for documentation (<To learn more about the APT Format, kindly refer to the 
+ {{{http://maven.apache.org/guides/mini/guide-apt-format.html}APT Format Guide}}>).
+
+ But to create a more complete version of a site, use 
+ <<<maven-archetype-site>>>.
  
 +------+
 mvn archetype:create 
@@ -43,7 +48,7 @@
   -DarchetypeArtifactId=maven-archetype-site
 +------+
 
- This would then create a maven proect.
+ This would then create a maven project.
 
 +------+
 .

Modified: maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/webapp.apt
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/webapp.apt?rev=427028&r1=427027&r2=427028&view=diff
==============================================================================
--- maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/webapp.apt (original)
+++ maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/webapp.apt Sun Jul 30 23:27:01 2006
@@ -8,8 +8,8 @@
  
 Creating a webapp
  
- Use maven-archetype-webapp to start a simple webapp maven project. The command
- is as follows"
+ Use <<<maven-archetype-webapp>>> to start a simple webapp maven project. The 
+ command is as follows
  
 +------+
 mvn archetype:create 
@@ -18,7 +18,7 @@
   -DarchetypeArtifactId=maven-archetype-webapp
 +------+
 
- This would then create a maven proect.
+ This would then create a maven project.
 
 +------+
 .

Modified: maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/index.apt?rev=427028&r1=427027&r2=427028&view=diff
==============================================================================
--- maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/index.apt (original)
+++ maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/index.apt Sun Jul 30 23:27:01 2006
@@ -18,46 +18,47 @@
  Upon writing this documentation, there are ten (10) available archetype 
  containers provided by maven These are:
  
-   * maven-archetype-archetype
+   * <<<maven-archetype-archetype>>>
    
-   * maven-archetype-j2ee-simple
+   * <<<maven-archetype-j2ee-simple>>>
    
-   * maven-archetype-mojo
+   * <<<maven-archetype-mojo>>>
    
-   * maven-archetype-portlet
+   * <<<maven-archetype-portlet>>>
    
-   * maven-archetype-profiles (<work in progress>)
+   * <<<maven-archetype-profiles>>> (<currently under development>)
    
-   * maven-archetype-quickstart
+   * <<<maven-archetype-quickstart>>>
    
-   * maven-archetype-simple (<work in progress>)
+   * <<<maven-archetype-simple>>> (<currently under development>)
    
-   * maven-archetype-site
+   * <<<maven-archetype-site>>>
    
-   * maven-archetype-site-simple, and 
+   * <<<maven-archetype-site-simple>>>, and 
    
-   * maven-archetype-webapp
+   * <<<maven-archetype-webapp>>>
 
 * Goals Overview
 
    The Archetype Plugin has two goals:
 
    * {{{create-mojo.html}archetype:create}} looks for an achetype with a given 
-     groupId, artifactId, and version and retrieves it from the remote 
-     repository. Once the archetype is retrieve it is process against a st of 
-     user parameters to create a working Maven project.
+     <<<groupId>>>, <<<artifactId>>>, and <<<version>>> and retrieves it from 
+     the remote repository. Once the archetype is retrieved, it is then 
+     processed against a set of user parameters to create a working Maven 
+     project.
 
    * {{{create-from-project-mojo.html}archetype:create-from-project}} creates an
      archetype from an existing Maven projecct.
 
 * Usage
 
-   Instructions on how to use the Resources Plugin can be found 
+   Instructions on how to use the Archetype Plugin can be found 
    {{{usage.html}here}}.
 
 * Examples
 
-   The following examples show how to use the Javadoc Plugin in more advanced 
+   The following examples show how to use the Archetype Plugin in more advanced 
    usecases:
 
    * {{{examples/remote-repositories.html}Specifying the Remote Repositories}}

Modified: maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/usage.apt
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/usage.apt?rev=427028&r1=427027&r2=427028&view=diff
==============================================================================
--- maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/usage.apt (original)
+++ maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/usage.apt Sun Jul 30 23:27:01 2006
@@ -8,24 +8,93 @@
 
 Usage
 
- The Archetype Plugin has two goals: create and create-from-project. 
-
 * Create
  
  The create goal creates a pom, the default files (source, test, resources, 
  test-resources, site-resources), in a specific directory structure. The most 
  basic way of using this is by calling the goal with only two expressions: the
- groupId and artifactId of the project to be build. For example, using
+ <<<groupId>>> and <<<artifactId>>> of the project to be build. For example, 
+ using
  
 +-----+
- mvn archetype:create -DgroupId=sample.group.id -DartifactId=sample-artifact-id
+ mvn archetype:create                              \
+  -DgroupId=sample.group.id                        \ 
+  -DartifactId=sample-artifact-id                  
++-----+                                                
+                                                            
+ this would create an <<<App.java>>> and an <<<AppTest.java>>>, both under the 
+ <<<sample.group.id>>> package. The <<<App.java>>> is a simple "Hello World" 
+ program while the <<<AppTest.java>>> is a subclass of 
+ <<<junit.framework.TestCase>>> that has one test which always passes.
+                                                       
+ You can also specify other parameters such as version of the project to be 
+ created, the <<<packageName>>> of the classes, <<<remoteRepositories>>> and 
+ <<<pomRemoteRepositories>>> (See 
+ {{{examples/remote-repositories.html}Specifying the Remote Repositories}}), 
+ and the <<<archetypeGroupId>>>, 
+ <<<archetypeArtifactId>>>, and <<<archetypeVersion>>>.
+                                                       
+ If the version is not specified, the default will be used which is 
+ <<<1.0-SNAPSHOT>>>. Also, if the <<<packageName>>> is not specified, the 
+ <<<maven-archetype-plugin>>> would derive the classes default package name 
+ based on the <<<groupId>>> (i.e. a <<<groupId sample.group.id>>> would have a 
+ default package name <<<sample.group.id>>>).
+                                                       
+ Moreover, if the <<<archetypeGroupId>>>, <<<archetypeArtifactId>>> and 
+ <<<archetypeVersion>>> is not specified (as with the example above), the 
+ default would be used, which is <<<org.apache.maven.archetypes>>>, 
+ <<<maven-archetype-quickstart>>> and <<<1.0-SNAPSHOT>>> respectively.                                            
+                                                       
+ Thus, the above command is the same as              
+                                                       
++-----+                                              
+ mvn archetype:create                                
+  -DgroupId=sample.group.id                        \
+  -DartifactId=sample-artifact-id                  \
+  -Dversion=1.0-SNAPSHOT                           \
+  -DpackageName=sample.group.id                    \
+  -DarchetypeGroupId=org.apache.maven.archetypes   \
+  -DarchetypeArtifactId=maven-archetype-quickstart \
+  -DarchetypeVersion=1.0-SNAPSHOT                  
++-----+                                                
+                                                   
+ But if you want to use a different archetype other than the default, you'd 
+ have to specify the following parameters: <<<archetypeGroupId>>>, 
+ <<<archetypeArtifactId>>>, and <<<archetypeVersion>>>.        
+                                                   
+ So for example, if you wish to create a project with a <<<groupId>>>
+ <<<my.company.projects>>>, <<<artifactId>>> <<<my-project>>>, using an 
+ archetype with an <<<artifactId>>> <<<my-archetype>>>, <<<version>>> 
+ <<<1.0-archetype-SNAPSHOT>>>, under the <<<groupId>>> 
+ <<<my.company.archetypes>>>, you'd have to execute        
+                                                   
++-----+                                                
+mvn archetype:create                               \
+  -DgroupId=my.company.projects                    \
+  -DartifactId=my-project                          \
+  -DarchetypeGroupId=my.company.archetypes         \
+  -DarchetypeArtifactId=my-archetype               \
+  -DarchetypeVersion=1.0-archetype-SNAPSHOT        
 +-----+
 
- this would create an App.java and an AppTest.java, both under the 
- sample.group.id package. The App.java is a simple "Hello World" program while 
- the AppTest is a subclass of TestCase that has one test which always passes.
+ But if the archetype that you're going to use has an element 
+ (<<<archetypeGroupId>>>, <<<archetypeArtifactId>>>, or <<<archetypeVersion>>>) 
+ has the same value as that of the default, then you don't have to specify that 
+ element.
+
+ For example, if you're going to use <<<maven-archetype-webapp>>>
+ <<<version>>> <<<1.0-SNAPSHOT>>> which is in under the <<<groupId>>>
+ <<<org.apache.maven.archetypes>>>, you can simply use the following command
+
++-----+
+mvn archetype:create
+  -DgroupId=my.company.projects
+  -DartifactId=another-project
+  -DarchetypeArtifactId=maven-archetype-webapp
++-----+
  
 * Create From Project
 
-  <work in progress>
- 
+ Builds archetype containers based from an existing Maven project (<currently 
+ under development>).
+