A document has been updated:
http://cocoon.zones.apache.org/daisy/documentation/1159.html
Document ID: 1159
Branch: main
Language: default
Name: Your first Cocoon application using Maven 2 (unchanged)
Document Type: Cocoon Document (unchanged)
Updated on: 6/20/08 8:40:52 PM
Updated by: David Legg
A new version has been created, state: draft
Parts
=====
Content
-------
This part has been updated.
Mime type: text/xml (unchanged)
File name: (unchanged)
Size: 6449 bytes (previous version: 5932 bytes)
Content diff:
<html>
<body>
+++ <h1>Creating a Cocoon block</h1>
+++
<p>In this tutorial, you will:</p>
<ol>
<li>Create a Cocoon block (the application resources and logic)</li>
--- <li>Import the block as project in Eclipse</li>
--- <li>Start the block as web application and access it from your browser</li>
+++ <li>Import the block as a project in Eclipse</li>
+++ <li>Start the block as a web application and access it from your
browser</li>
</ol>
--- <h1>Creating a block</h1>
---
--- <p class="note">First, make sure that you have Maven 2.0.6 or above
installed.
--- You can check this by calling mvn --version from command line. If this
doesn't
--- work for you, read the
+++ <p class="note">First, make sure that you have Maven 2.0.9 or above
installed.
+++ You can check this by calling mvn --version from the command line. If this
+++ doesn't work for you, read the
<a
href="http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html">Maven
in 5 Minutes</a> tutorial.</p>
<p>Create a new directory which will be the root directory of your Cocoon
application. For this tutorial, let's name it
<tt>getting-started-app</tt>.</p>
--- <p>The next step is creating a Cocoon block which will contain your custom
--- application. The development of any Cocoon web application should be done
within
--- a block. Again, for this purpose there is a Maven archetype:</p>
+++ <p>The next step is to create a Cocoon block to contain your custom
application.
+++ The development of any Cocoon web application should be done within a
block.</p>
--- <pre>mvn archetype:create
--- -DarchetypeGroupId=org.apache.cocoon
+++ <p>We could manually create the necessary file and folder structure of the
+++ block, but a simpler route is to use Maven's 'archetype' plugin. This
allows us
+++ to select the kind of block we desire from a list and have Maven do the
work.
+++ The default list of archetypes is quite large so , for convenience, a
catalog of
+++ Cocoon archetypes has been posted on the Cocoon web site
+++ (<a
href="http://cocoon.apache.org/archetype-catalog.xml">http://cocoon.apache.org/archetype-catalog.xml</a>)
+++ and we shall make use of it as follows: -</p>
+++
+++ <pre>mvn archetype:generate
-DarchetypeCatalog=http://cocoon.apache.org/archetype-catalog.xml
-DarchetypeArtifactId=cocoon-22-archetype-block
-DarchetypeVersion=1.0.0
-DgroupId=com.mycompany
(114 equal lines skipped)