maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From och...@apache.org
Subject svn commit: r425587 - in /maven/archetype/trunk: ./ maven-archetype/maven-archetype-plugin/ maven-archetype/maven-archetype-plugin/src/main/java/org/apache/maven/plugin/archetype/ maven-archetype/maven-archetype-plugin/src/site/ maven-archetype/maven-a...
Date Wed, 26 Jul 2006 02:40:15 GMT
Author: oching
Date: Tue Jul 25 19:40:14 2006
New Revision: 425587

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

Added documentation for maven archetype plugin.

Added:
    maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/
    maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/
    maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/
    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
    maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/fml/
    maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/fml/faq.fml
    maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/site.xml
Modified:
    maven/archetype/trunk/maven-archetype/maven-archetype-plugin/pom.xml
    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/pom.xml

Modified: maven/archetype/trunk/maven-archetype/maven-archetype-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/maven-archetype/maven-archetype-plugin/pom.xml?rev=425587&r1=425586&r2=425587&view=diff
==============================================================================
--- maven/archetype/trunk/maven-archetype/maven-archetype-plugin/pom.xml (original)
+++ maven/archetype/trunk/maven-archetype/maven-archetype-plugin/pom.xml Tue Jul 25 19:40:14
2006
@@ -9,6 +9,46 @@
   <artifactId>maven-archetype-plugin</artifactId>
   <packaging>maven-plugin</packaging>
   <name>Maven Archetype Plugin</name>
+  <description>
+	The Maven Archetype Plugin builds archetype containers.
+  </description>
+  <url>http://maven.apache.org/plugins/maven-archetype-plugin/</url>
+  <inceptionYear>2001</inceptionYear>
+  <mailingLists>
+    <mailingList>
+      <name>Maven User List</name>
+      <subscribe>users-subscribe@maven.apache.org</subscribe>
+      <unsubscribe>users-unsubscribe@maven.apache.org</unsubscribe>
+      <post>users@maven.apache.org</post>
+      <archive>http://mail-archives.apache.org/mod_mbox/maven-users</archive>
+      <otherArchives>
+        <otherArchive>http://www.mail-archive.com/users@maven.apache.org/</otherArchive>
+        <otherArchive>http://www.nabble.com/Maven---Users-f178.html</otherArchive>
+      </otherArchives>
+    </mailingList>
+    <mailingList>
+      <name>Maven Developer List</name>
+      <subscribe>dev-subscribe@maven.apache.org</subscribe>
+      <unsubscribe>dev-unsubscribe@maven.apache.org</unsubscribe>
+      <post>dev@maven.apache.org</post>
+      <archive>http://mail-archives.apache.org/mod_mbox/maven-dev</archive>
+    </mailingList>
+    <mailingList>
+      <name>Maven Commits List</name>
+      <subscribe>commits-subscribe@maven.apache.org</subscribe>
+      <unsubscribe>commits-unsubscribe@maven.apache.org</unsubscribe>
+      <post>commits@maven.apache.org</post>
+      <archive>http://mail-archives.apache.org/mod_mbox/maven-dev</archive>
+    </mailingList>
+  </mailingLists>
+  <scm>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/maven/archetype/trunk/maven-archetype/maven-archetype-plugin/</connection>
+    <developerConnection>scm:svn:http://svn.apache.org/repos/asf/maven/archetype/trunk/maven-archetype/maven-archetype-plugin/</developerConnection>
+    <url>http://svn.apache.org/repos/asf/maven/archetype/trunk/maven-archetype/maven-archetype-plugin/</url>
+  </scm>
+  <prerequisites>
+    <maven>2.0</maven>
+  </prerequisites>
   <dependencies>
     <dependency>
       <groupId>org.apache.maven</groupId>
@@ -34,4 +74,46 @@
       <artifactId>maven-archetype-creator</artifactId>
     </dependency>
   </dependencies>
+  <reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-plugin-plugin</artifactId>
+        <version>2.2-SNAPSHOT</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jxr-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-javadoc-plugin</artifactId>
+      </plugin>
+    </plugins>
+  </reporting>
+  <profiles>
+    <profile>
+      <id>ciProfile</id>
+      <activation>
+        <property>
+          <name>enableCiProfile</name>
+          <value>true</value>
+        </property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-docck-plugin</artifactId>
+            <executions>
+              <execution>
+                <goals>
+                  <goal>check</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
 </project>

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=425587&r1=425586&r2=425587&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
Tue Jul 25 19:40:14 2006
@@ -27,7 +27,8 @@
 import java.io.FileInputStream;
 
 /**
- * Builds archetype containers.
+ * Builds archetype containers based from an existing Maven project (work in
+ * progress).
  *
  * @goal create-from-project
  * @description Create an archetype from an existing Maven project.
@@ -37,24 +38,32 @@
     extends AbstractMojo
 {
     /**
+     * The Maven Project to be used as the basis for the creating of the archetype.
+     * 
      * @parameter expression="${project}"
      * @required
      */
     private MavenProject project;
 
     /**
+     * Maven's local repository.
+     * 
      * @parameter expression="${localRepository}"
      * @required
      */
     private ArtifactRepository localRepository;
 
     /**
+     * Output build directory.
+     *  
      * @parameter expression="${targetDirectory}" default-value="${project.build.directory}"
      * @required
      */
     private File targetDirectory;
 
     /**
+     * Maven ArchetypeCreator
+     * 
      * @component
      */
     private ArchetypeCreator archetypeCreator;
@@ -68,6 +77,8 @@
 
 
     /**
+     * Contains Archetype Properties.
+     * 
      * @parameter expression="${archetypeProperties}" default-value="${basedir}/src/main/archetype/archetype.properties"
      * @required
      */

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=425587&r1=425586&r2=425587&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
Tue Jul 25 19:40:14 2006
@@ -39,6 +39,7 @@
  * 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.
  *
+ * @description Creates archetype containers.
  * @requiresProject false
  * @goal create
  */
@@ -46,78 +47,109 @@
     extends AbstractMojo
 {
     /**
+     * Used to create the Archetype specified by the groupId, artifactId, and 
+     * version from the remote repository.
+     * 
      * @component
      */
     private Archetype archetype;
 
     /**
+     * Used to create ArtifactRepository objects given the urls of the remote
+     * repositories.
+     * 
      * @component
      */
     private ArtifactRepositoryFactory artifactRepositoryFactory;
 
     /**
+     * Determines whether the layout is legacy or not.
+     * 
      * @component role="org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout"
roleHint="default"
      */
     private ArtifactRepositoryLayout defaultArtifactRepositoryLayout;
 
 
     /**
+     * Maven's local repository.
+     * 
      * @parameter expression="${localRepository}"
      * @required
      */
     private ArtifactRepository localRepository;
 
     /**
-     * @parameter expression="${archetypeGroupId}" default-value="org.apache.maven.archetypes"
+     * The Archetype Group Id to be used.
+     * 
+     * @parameter expression="${archetypeGroupId}" default-value="org.apache.maven.archetype"
      * @required
      */
     private String archetypeGroupId;
 
     /**
+     * The Archetype Artifact Id to be used.
+     * 
      * @parameter expression="${archetypeArtifactId}" default-value="maven-archetype-quickstart"
      * @required
      */
     private String archetypeArtifactId;
 
     /**
+     * The Archetype Version to be used.
+     * 
      * @parameter expression="${archetypeVersion}" default-value="RELEASE"
      * @required
      */
     private String archetypeVersion;
 
     /**
+     * The Group Id of the project to be build.
+     * 
      * @parameter expression="${groupId}"
      */
     private String groupId;
 
     /**
+     * The Artifact Id of the project to be build.
+     * 
      * @parameter expression="${artifactId}"
      */
     private String artifactId;
 
     /**
+     * The Version of the project to be build.
+     * 
      * @parameter expression="${version}" default-value="1.0-SNAPSHOT"
      * @required
      */
     private String version;
 
     /**
+     * The Package Name of the project to be build.
+     * 
      * @parameter expression="${packageName}" alias="package"
      */
     private String packageName;
 
     /**
+     * The remote repositories available for discovering dependencies and extensions as indicated
+     * by the POM.
+     * 
      * @parameter expression="${project.remoteArtifactRepositories}"
      * @required
      */
     private List pomRemoteRepositories;
 
     /**
+     * Other remote repositories available for discovering dependencies and extensions.
+     * 
      * @parameter expression="${remoteRepositories}"
      */
     private String remoteRepositories;
 
     /**
+     * The project to be created an archetype of.
+     * 
      * @parameter expression="${project}"
      */
     private MavenProject project;

Added: 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=425587&view=auto
==============================================================================
--- maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/archetype.apt
(added)
+++ maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/archetype.apt
Tue Jul 25 19:40:14 2006
@@ -0,0 +1,184 @@
+ ------
+ Guide to Creating Archetypes
+ ------
+ Jason van Zyl, Alexander Hars, Franz Allan Valencia See
+ ------
+ 26 October 2005
+ ------
+
+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: 
+ 
+ * 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 prototpye pom (<pom.xml> in: <src/main/resources/archetype-resources>)
+
+ * a pom for the archetype (<pom.xml> in the archetype's root directory).
+
+ [] 
+
+ To create an archetype follow these steps:
+
+* 1. Create a new project and pom.xml for the archetype plugin
+
+  An example <pom.xml> for an archetype plugin looks as follows: 
+ 
++----+ 
+
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>my.groupId</groupId>
+  <artifactId>my-archetype-id</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>maven-plugin</packaging>
+</project>
+
++----+ 
+
+  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: 
+
++----+
+
+<archetype>
+  <id>quickstart</id>
+  <sources>
+    <source>src/main/java/App.java</source>
+  </sources>
+  <testSources>
+    <source>src/test/java/AppTest.java</source>
+  </testSources>
+</archetype>
+
++----+
+
+ 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. 
+
+ The \<sources\>, \<resources\>, \<test-resources\> and \<site-resources\>
tags represent the different sections of the project: 
+
+ * \<sources\> = src/main/java
+
+ * \<resources\> = src/main/resources
+
+ * \<test-sources\> = src/test/java
+
+ * \<test-resources\> = src/test/resources
+
+ * \<site-resources\> = src/site 
+
+ []
+
+ \<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. 
+
+ 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.

+
+ Thus the quickstart archetype shown above defines the following directory structure: 
+
++----+
+
+archetype
+|-- pom.xml
+`-- src
+    `-- main
+        `-- resources
+            |-- META-INF
+            |   `-- archetype.xml
+            `-- archetype-resources
+                |-- pom.xml
+                `-- src
+                    |-- main
+                    |   `-- java
+                    |       `-- App.java
+                    `-- test
+                        `-- java
+                            `-- AppTest.java
+
++----+
+
+* 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>.   
+
+ An example for a prototype <pom.xml> is: 
+
++----+
+
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>${groupId}</groupId>
+  <artifactId>${artifactId}</artifactId>
+  <packaging>jar</packaging>
+  <version>${version}</version>
+  <name>A custom project</name>
+  <url>http://www.myorganization.org</url>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>
+
++----+
+
+* 4. Install and run the archetype
+
+ Now you are ready to install the archetype: 
+
++----+
+
+mvn install 
+
++----+
+
+ 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>
+
++----+
+
+ 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
+ 
+ Instead of manually creating the directory structure needed for an archetype, 
+ simply use 
+ 
++------+
+mvn archetype:create 
+  -DgroupId=[your project's group id]
+  -DartifactId=[your project's artifact id]
+  -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).

Added: 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=425587&view=auto
==============================================================================
--- maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/j2ee-simple.apt
(added)
+++ maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/j2ee-simple.apt
Tue Jul 25 19:40:14 2006
@@ -0,0 +1,57 @@
+ ------
+ J2ee Simple
+ ------
+ Franz Allan Valencia See
+ ------
+ July 2006
+ ------
+ 
+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.
+ 
++------+
+mvn archetype:create 
+  -DgroupId=[your project's group id]
+  -DartifactId=[your project's artifact id]
+  -DarchetypeArtifactId=maven-archetype-j2ee-simple
++------+
+
+ This would then create a maven proect.
+
++------+
+.
+ |-- ear
+ |   `-- pom.xml
+ |-- ejb
+ |   |-- src   
+ |   |   `-- main
+ |   |       `-- resources
+ |   |           `-- META-INF
+ |   |               `-- ejb-jar.xml
+ |   `-- pom.xml
+ |-- primary-source
+ |   `-- pom.xml
+ |-- projects
+ |   |-- logging
+ |   |   `-- pom.xml
+ |   `-- pom.xml
+ |-- servlets
+ |   |-- servlet
+ |   |   |-- src
+ |   |   |   `-- main
+ |   |   |       `-- webapp
+ |   |   |            |-- WEB-INF
+ |   |   |            |   `-- web.xml
+ |   |   |            `-- index.jsp
+ |   |   `-- pom.xml
+ |   `-- pom.xml
+ |-- src
+ |   `-- main
+ |       `-- resources
+  `-- pom.xml
++------+
+
+

Added: 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=425587&view=auto
==============================================================================
--- maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/mojo.apt
(added)
+++ maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/mojo.apt
Tue Jul 25 19:40:14 2006
@@ -0,0 +1,33 @@
+ ------
+ Mojo
+ ------
+ Franz Allan Valencia See
+ ------
+ July 2006
+ ------
+ 
+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.
+ 
++------+
+mvn archetype:create 
+  -DgroupId=[your project's group id]
+  -DartifactId=[your project's artifact id]
+  -DarchetypeArtifactId=maven-archetype-mojo
++------+
+
+ This would then create a maven proect.
+
++------+
+.
+ |-- src
+ |   `-- main
+ |       `-- java
+ |           `-- [your project's package] 
+ |               `-- MyMojo.java
+  `-- pom.xml
++------+
+
+

Added: 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=425587&view=auto
==============================================================================
--- maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/portlet.apt
(added)
+++ maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/portlet.apt
Tue Jul 25 19:40:14 2006
@@ -0,0 +1,46 @@
+ ------
+ Portlet
+ ------
+ Franz Allan Valencia See
+ ------
+ July 2006
+ ------
+ 
+Creating a portlet
+ 
+ Use maven-archetype-webapp to start a simple webapp maven project. The command
+ is as follows"
+ 
++------+
+mvn archetype:create 
+  -DgroupId=[your project's group id]
+  -DartifactId=[your project's artifact id]
+  -DarchetypeArtifactId=maven-archetype-portlet
++------+
+
+ This would then create a maven proect.
+
++------+
+.
+ |-- src
+ |   `-- main
+ |       `-- java
+ |           |-- [your project's package] 
+ |           |   `-- MyPortal.java
+ |           |-- jetspeed
+ |           |   `-- web.xml
+ |           |-- resources
+ |           |-- webapp
+ |           |   |-- WEB-INF
+ |           |   |   |-- tld
+ |           |   |   |   `-- portlet.tld
+ |           |   |   |-- portlet.xml
+ |			 |   |   `-- web.xml
+ |           |   |-- help.jsp
+ |           |   |-- maximized.jsp
+ |           |   `-- normal.jsp
+ |           `-- index.jsp
+  `-- pom.xml
++------+
+
+

Added: 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=425587&view=auto
==============================================================================
--- maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/remote-repositories.apt
(added)
+++ maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/remote-repositories.apt
Tue Jul 25 19:40:14 2006
@@ -0,0 +1,67 @@
+ ------
+ Remote Repositories
+ ------
+ Franz Allan Valencia See
+ ------
+ July 2006
+ ------
+
+
+Specifying the Remote Repositories
+
+ To use an archetype found in a remote repository, use the remoteRepositories 
+ -D expression. 
+ 
++------+
+mvn archetype:create 
+  -DgroupId=[your group id]
+  -DartifactId=[your artifact id]
+  -DarchetypeGroupId=[group id of the remote archetype]
+  -DarchetypeArtifactId=[artifact id of the remote archetype]
+  -DarchetypeVersion=[version of the remote archetype]
+  -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
+ 
++------+
+mvn archetype:create                                                    \
+  -DgroupId=your.proj.gid                                               \
+  -DartifactId=your-proj-aid                                            \
+  -DarchetypeGroupId=remote.archetype.gid                               \
+  -DarchetypeArtifactId=remote-archetype-aid                            \
+  -DarchetypeVersion=1.0                                                \
+  -DremoteRepositories=http://remote.archetypes.url                     
++------+
+
+ Moreover, you can specify several remote repositories by using a comma (,).
+ 
++------+
+mvn archetype:create                                                    \
+  -DgroupId=your.proj.gid                                               \
+  -DartifactId=your-proj-aid                                            \
+  -DarchetypeGroupId=remote.archetype.gid                               \
+  -DarchetypeArtifactId=remote-archetype-aid                            \
+  -DarchetypeVersion=1.0                                                \
+  -DremoteRepositories=http://remote.archetypes.url,http://another.url  
++------+
+
+ Furthermore, you can specify your remote repositories through a parent pom.
+ 
++------+
+<project>
+  [...]
+  <packaging>pom</packaging>
+  [...]
+  <repositories>
+    <repository>
+      [...]
+      <id> [remote repository id] </id>
+      <url> [remote repository's url] </url>
+      [...]
+    </repository>
+  </repositories>
+</project>
++------+

Added: 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=425587&view=auto
==============================================================================
--- maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/simple.apt
(added)
+++ maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/simple.apt
Tue Jul 25 19:40:14 2006
@@ -0,0 +1,64 @@
+ ------
+ Simple
+ ------
+ Franz Allan Valencia See
+ ------
+ July 2006
+ ------
+ 
+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).
+ 
++------+
+mvn archetype:create 
+  -DgroupId=[your project's group id]
+  -DartifactId=[your project's artifact id]
++------+
+
+ This would then create a maven proect.
+
++------+
+.
+ |-- src
+ |   |-- main
+ |   |   `-- java
+ |   |       `-- [your project's package]   
+ |   |           `-- App.java
+ |   `-- test
+ |       `-- java
+ |           `-- [your project's package]   
+ |               `-- AppTest.java
+  `-- pom.xml
++------+
+
+ For example if we execute this command
+ 
++------+
+mvn archetype:create 
+  -DgroupId=your.simple.java.gid 
+  -DartifactId=your-simple-java-aid
++------+
+ 
+ We would get this
+ 
++------+
+.
+ |-- src
+ |   |-- main
+ |   |   `-- java
+ |   |       `-- your
+ |   |           `-- simple
+ |   |               `-- java
+ |   |                   `-- aid
+ |   |                       `-- App.java
+ |   `-- test
+ |       `-- java
+ |           `-- your
+ |               `-- simple
+ |                   `-- java
+ |                       `-- aid
+ |                           `-- AppTest.java
+  `-- pom.xml
++------+

Added: 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=425587&view=auto
==============================================================================
--- maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/site.apt
(added)
+++ maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/site.apt
Tue Jul 25 19:40:14 2006
@@ -0,0 +1,182 @@
+ ------
+ Site
+ ------
+ Franz Allan Valencia See
+ ------
+ July 2006
+ ------
+ 
+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.
+ 
+ To jump start a simple site, choose maven-archetype-site-simple, 
+ 
++------+
+mvn archetype:create 
+  -DgroupId=[your project's group id]
+  -DartifactId=[your project's artifact id]
+  -DarchetypeArtifactId=maven-archetype-site-simple
++------+ 
+
+ and it will generate a maven projecct with the following contents.
+ 
++------+
+.
+ |-- src
+ |   `-- main
+ |       `-- site
+ |           |-- apt
+ |           |   `-- index.apt
+ |           `-- site.xml
+  `-- pom.xml
++------+ 
+
+ But to create a more complete version of a site, use maven-archetype-site.
+ 
++------+
+mvn archetype:create 
+  -DgroupId=[your project's group id]
+  -DartifactId=[your project's artifact id]
+  -DarchetypeArtifactId=maven-archetype-site
++------+
+
+ This would then create a maven proect.
+
++------+
+.
+ |-- src
+ |   `-- main
+ |       `-- site
+ |           |-- apt
+ |           |   |-- format.apt
+ |           |   `-- index.apt
+ |           |-- fml
+ |           |   `-- faq.fml
+ |           |-- fr
+ |           |   |-- apt
+ |           |   |   |-- format.apt
+ |           |   |   `-- index.apt
+ |           |   |-- fml
+ |           |   |   `-- faq.fml
+ |           |   `-- xdoc
+ |           |       `-- xdoc.xml
+ |           |-- xdoc
+ |           |   `-- xdoc.xml
+ |           |-- site.xml
+ |           `-- site_fr.xml
+  `-- pom.xml
++------+
+
+ Furthermore, both archetypes are capable of creating archetype containers over
+ an existing maven project. For example, if we first create a simple j2ee maven
+ project.
+ 
++------+
+mvn archetype:create 
+  -DgroupId=sample.gid
+  -DartifactId=sample-aid
+  -DarchetypeArtifactId=maven-archetype-j2ee-simple
++------+
+
+ We would have the following contents for our maven project.
+
++------+
+.
+ |-- ear
+ |   `-- pom.xml
+ |-- ejb
+ |   |-- src   
+ |   |   `-- main
+ |   |       `-- resources
+ |   |           `-- META-INF
+ |   |               `-- ejb-jar.xml
+ |   `-- pom.xml
+ |-- primary-source
+ |   `-- pom.xml
+ |-- projects
+ |   |-- logging
+ |   |   `-- pom.xml
+ |   `-- pom.xml
+ |-- servlets
+ |   |-- servlet
+ |   |   |-- src
+ |   |   |   `-- main
+ |   |   |       `-- webapp
+ |   |   |            |-- WEB-INF
+ |   |   |            |   `-- web.xml
+ |   |   |            `-- index.jsp
+ |   |   `-- pom.xml
+ |   `-- pom.xml
+ |-- src
+ |   `-- main
+ |       `-- resources
+  `-- pom.xml
++------+
+
+ And if we envoke the following commands from the same directory.
+ 
++------+
+mvn archetype:create 
+  -DgroupId=sample.gid
+  -DartifactId=sample-aid
+  -DarchetypeArtifactId=maven-archetype-site
++------+
+
+ The contents of the site archetype would then insert itself with that of the 
+ existing maven project.
+ 
++------+
+.
+ |-- ear
+ |   `-- pom.xml
+ |-- ejb
+ |   |-- src   
+ |   |   `-- main
+ |   |       `-- resources
+ |   |           `-- META-INF
+ |   |               `-- ejb-jar.xml
+ |   `-- pom.xml
+ |-- primary-source
+ |   `-- pom.xml
+ |-- projects
+ |   |-- logging
+ |   |   `-- pom.xml
+ |   `-- pom.xml
+ |-- servlets
+ |   |-- servlet
+ |   |   |-- src
+ |   |   |   `-- main
+ |   |   |       `-- webapp
+ |   |   |            |-- WEB-INF
+ |   |   |            |   `-- web.xml
+ |   |   |            `-- index.jsp
+ |   |   `-- pom.xml
+ |   `-- pom.xml
+ |-- src
+ |   `-- main
+ |       |-- resources
+ |       `-- site
+ |           |-- apt
+ |           |   |-- format.apt
+ |           |   `-- index.apt
+ |           |-- fml
+ |           |   `-- faq.fml
+ |           |-- fr
+ |           |   |-- apt
+ |           |   |   |-- format.apt
+ |           |   |   `-- index.apt
+ |           |   |-- fml
+ |           |   |   `-- faq.fml
+ |           |   `-- xdoc
+ |           |       `-- xdoc.xml
+ |           |-- xdoc
+ |           |   `-- xdoc.xml
+ |           |-- site.xml
+ |           `-- site_fr.xml
+  `-- pom.xml
++------+
+
+ while retaining the existing maven project's pom.

Added: 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=425587&view=auto
==============================================================================
--- maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/webapp.apt
(added)
+++ maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/examples/webapp.apt
Tue Jul 25 19:40:14 2006
@@ -0,0 +1,36 @@
+ ------
+ Webapp
+ ------
+ Franz Allan Valencia See
+ ------
+ July 2006
+ ------
+ 
+Creating a webapp
+ 
+ Use maven-archetype-webapp to start a simple webapp maven project. The command
+ is as follows"
+ 
++------+
+mvn archetype:create 
+  -DgroupId=[your project's group id]
+  -DartifactId=[your project's artifact id]
+  -DarchetypeArtifactId=maven-archetype-webapp
++------+
+
+ This would then create a maven proect.
+
++------+
+.
+ |-- src
+ |   `-- main
+ |       `-- java
+ |           |-- resources
+ |           |-- webapp
+ |           |   `-- WEB-INF
+ |           |       `-- web.xml
+ |           `-- index.jsp
+  `-- pom.xml
++------+
+
+

Added: 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=425587&view=auto
==============================================================================
--- maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/index.apt (added)
+++ maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/index.apt Tue
Jul 25 19:40:14 2006
@@ -0,0 +1,81 @@
+ ------
+ Introduction
+ ------
+ Franz Allan Valencia See
+ ------
+ 17 July 2006
+ ------
+
+
+Maven 2 Archetype Plugin
+
+ The Archetype Plugin allows the user to build archetype containers. These 
+ archetype containers contains the pom, default source, test, resources,
+ test-resources, and site-resources files in a specific directory structure. The 
+ content of the pom, the default files, and the directory structure depends on 
+ the what archetype container was built. 
+ 
+ Upon writing this documentation, there are ten (10) available archetype 
+ containers provided by maven These are:
+ 
+   * maven-archetype-archetype
+   
+   * maven-archetype-j2ee-simple
+   
+   * maven-archetype-mojo
+   
+   * maven-archetype-portlet
+   
+   * maven-archetype-profiles (<work in progress>)
+   
+   * maven-archetype-quickstart
+   
+   * maven-archetype-simple (<work in progress>)
+   
+   * maven-archetype-site
+   
+   * maven-archetype-site-simple, and 
+   
+   * 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.
+
+   * {{{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 
+   {{{usage.html}here}}.
+
+* Examples
+
+   The following examples show how to use the Javadoc Plugin in more advanced 
+   usecases:
+
+   * {{{examples/remote-repositories.html}Specifying the Remote Repositories}}
+
+   * {{{examples/simple.html}Creating a Simple Java Application}}
+
+   * {{{examples/site.html}Creating a Site}}
+
+   * {{{examples/j2ee-simple.html}Creating a Simple J2ee Project}}
+
+   * {{{examples/webapp.html}Creating a Webapp}}
+
+   * {{{examples/portlet.html}Creating a Portlet}}
+
+   * {{{examples/mojo.html}Creating a Mojo}}
+
+   * {{{examples/archetype.html}Creating your own Archetype}}
+   
+   
+   
+

Added: 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=425587&view=auto
==============================================================================
--- maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/usage.apt (added)
+++ maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/apt/usage.apt Tue
Jul 25 19:40:14 2006
@@ -0,0 +1,31 @@
+ ------
+ Usage
+ ------
+ Franz Allan Valencia See
+ ------
+ 17 July 2006
+ ------
+
+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
+ 
++-----+
+ 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 is a subclass of TestCase that has one test which always passes.
+ 
+* Create From Project
+
+  <work in progress>
+ 

Added: maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/fml/faq.fml
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/fml/faq.fml?rev=425587&view=auto
==============================================================================
--- maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/fml/faq.fml (added)
+++ maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/fml/faq.fml Tue
Jul 25 19:40:14 2006
@@ -0,0 +1,56 @@
+<?xml version="1.0"?>
+<faqs id="FAQ" title="Frequently Asked Questions">
+  <part id="General">
+    <faq id="What is Archetype?">
+      <question>
+        What is Archetype?
+      </question>
+      <answer>
+        <p>In short, Archetype is a Maven project templating toolkit. An 
+        archetype is defined as <i>an original pattern or model from which all 
+        other things of the same  kind are made</i>. The names fits as we are 
+        trying to provide a system that provides a consistent means of 
+        generating Maven projects. Archetype will help authors create Maven 
+        project templates for users, and provides users with the means to 
+        generate parameterized versions of those project templates.</p>
+
+        <p>Using archetypes provides a great way to enable developers quickly in
+        a way consistent with best practices employed by your project or 
+        organization. Within the Maven project we use archetypes to try and get 
+        our users up and running as quickly as possible by providing a sample 
+        project that demonstrates many of the features of Maven while 
+        introducing new users to the best practices employed by Maven. In a 
+        matter of seconds a new user can have a working Maven project to use as 
+        a jumping board for investigating more of the features in Maven. We have
+        also tried to make the Archetype mechanism additive and by that we mean 
+        allowing portions of a project to be captured in an archetype so that 
+        pieces or aspects of a project can be added to existing projects. A good
+        example of this is the Maven site archetype. If, for example, you have 
+        used the quick start archetype to generate a working project you can 
+        then quickly create a site for that project by using the site archetype 
+        within that existing project. You can do anything like this with 
+        archetypes. </p>
+
+        <p>You may want to standardize J2EE development within your organization
+        so you may want to provide archetypes for EJBs, or WARs, or for your web
+        services. Once these archetypes are created and deployed in your 
+        organization's repository they are available for use by all developers 
+        within your organization.</p>
+      </answer>
+    </faq>
+    <faq id="What makes up an Archetype?">
+      <question>
+        What makes up an Archetype?
+      </question>
+      <answer>
+        <p>Archetypes are packaged up in a JAR and they consist of the archetype
+        metadata which describes the contents of archetype and a set of 
+        <a href = "http://jakarta.apache.org/velocity">Velocity </a> templates

+        which make up the prototype project. If you would like to know how to 
+        make your own archetypes please refer to our <a href = 
+        "http://maven.apache.org/guides/mini/guide-creating-archetypes.html">
+        Guide to creating archetypes</a>.</p>
+      </answer>
+    </faq>
+  </part>
+</faqs>

Added: maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/site.xml
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/site.xml?rev=425587&view=auto
==============================================================================
--- maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/site.xml (added)
+++ maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/site/site.xml Tue Jul
25 19:40:14 2006
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+  ~ Copyright 2006 The Apache Software Foundation.
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<project name="Maven Archetype Plugin">
+  <bannerLeft>
+    <name>Maven Archetype Plugin</name>
+    <src>http://maven.apache.org/images/apache-maven-project.png</src>
+    <href>http://maven.apache.org/</href>
+  </bannerLeft>
+  <bannerRight>
+    <src>http://maven.apache.org/images/maven-small.gif</src>
+  </bannerRight>
+  <body>
+    <links>
+      <item name="Maven 2" href="http://maven.apache.org/maven2/"/>
+    </links>
+
+    <menu name="Overview">
+      <item name="Introduction" href="index.html"/>
+      <item name="Usage" href="usage.html"/>
+      <item name="Goals" href="plugin-info.html"/>      
+      <item name="FAQ" href="faq.html"/>
+    </menu>
+    <menu name="Examples">
+      <item name="Specifying the Remote Repositories" href="/examples/remote-repositories.html"/>
+      <item name="Creating a Simple Java Application" href="/examples/simple.html"/>
+	  <item name="Creating a Site" href="/examples/site.html"/>
+      <item name="Creating a Simple j2ee Project" href="/examples/j2ee-simple.html"/>
+	  <item name="Creating a Webapp" href="/examples/webapp.html"/>
+	  <item name="Creating a Portlet" href="/examples/portlet.html"/>
+      <item name="Creating a Mojo" href="/examples/mojo.html"/>
+	  <item name="Creating your own Archetype" href="/examples/archetype.html"/>
+    </menu>
+    ${reports}
+  </body>
+</project>

Modified: maven/archetype/trunk/pom.xml
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/pom.xml?rev=425587&r1=425586&r2=425587&view=diff
==============================================================================
--- maven/archetype/trunk/pom.xml (original)
+++ maven/archetype/trunk/pom.xml Tue Jul 25 19:40:14 2006
@@ -13,7 +13,7 @@
   <name>Maven Archetype Parent</name>
   <issueManagement>
     <system>jira</system>
-    <url>http://jira.codehaus.org/browse/MARCHETYPE</url>
+    <url>http://jira.codehaus.org/browse/ARCHETYPE</url>
   </issueManagement>            
   <modules>
      <module>maven-archetype</module>



Mime
View raw message