cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@cocoon.zones.apache.org
Subject [DAISY] Updated: Cocoon's Mavenization
Date Mon, 09 Jan 2006 19:17:14 GMT
A document has been updated:

http://cocoon.zones.apache.org/daisy/documentation/756.html

Document ID: 756
Branch: main
Language: default
Name: Cocoon's Mavenization (unchanged)
Document Type: Cocoon Document (unchanged)
Updated on: 1/9/06 7:16:57 PM
Updated by: Jorg Heymans

A new version has been created, state: publish

Parts
=====
Content
-------
This part has been updated.
Mime type: text/xml (unchanged)
File name:  (unchanged)
Size: 6341 bytes (previous version: 4512 bytes)
Content diff:
    <html>
    <body>
    
--- <h1>Welcome to Cocoon 2.2's Mavenization Page</h1>
+++ <h1>Welcome to Cocoon 2.2's M10N Page</h1>
    
--- <p>(Note : the maven build of cocoon is hereafter referred to as M10N)</p>
+++ <h2>List of useful maven commands</h2>
    
--- <h2>Status</h2>
--- 
--- <ul>
--- <li>core and all blocks are under pom control, ie all have a pom.xml with
--- correct dependencies. This means that cocoon is compileable and jar-able with
--- maven <strong>today</strong>.</li>
--- <li>pom include &lt;testSourceDirectory/&gt; directives, which means you
can run
--- tests</li>
--- <li>webapp pom is defined</li>
--- <li>cocoon "master" pom is defined with all modules</li>
--- </ul>
--- 
--- <h2>Current Structure</h2>
--- 
--- <p>below was supposed to be a nice directory tree structure but daisy somehow
--- mangled it .... bad Daisy !</p>
--- 
--- <p align="left">/repository-root<br/>
--- <strong>pom.xml </strong>-&gt; defines all modules <br/>
--- /repository-root /core<br/>
--- <strong>pom.xml </strong>-&gt; cocoon-core definition<br/>
--- /repository-root/webapp<br/>
--- <strong>pom.xml</strong> -&gt; webapp definition<br/>
--- /repository-root/src/blocks<br/>
--- /repository-root /src/blocks/apples<br/>
--- <strong>pom.xml </strong>-&gt; block definition <br/>
--- /repository-root /src/blocks/authentication-fw<br/>
--- <strong>pom.xml</strong></p>
--- 
--- <h2>Good to know if you want to try out M10N</h2>
--- 
    <p>Below commands always execute using pom.xml in the current directory, unless
    otherwise specified. Thus if you execute it in the repository root where the
--- master pom.xml is defined, maven will subsequently run the goal for all blocks.
--- </p>
+++ master pom.xml is defined, maven will subsequently run the goal for all blocks
+++ as well.</p>
    
    <h5>compile a module</h5>
    
(3 equal lines skipped)
    
    <p><tt>$mvn package</tt></p>
    
--- <h5>install a module in the local repository (meaning its definition can be
+++ <h5>install a module in your local repository (meaning its definition can be
    reused by your other modules)</h5>
    
+++ <p>When a module is installed locally you can reference it from other poms.</p>
+++ 
    <p><tt>$mvn install</tt></p>
    
--- <h5>switch-off testing</h5>
+++ <h5>disable unittests</h5>
    
--- <p>maven by default runs tests, use <tt>-Dmaven.test.skip=true </tt>to
disable
--- them</p>
+++ <p>maven by default runs all tests, use <tt>mvn -Dmaven.test.skip=true ...
+++ </tt>to disable them</p>
    
    <h5>build offline</h5>
    
--- <p><tt>$mvn -o &lt;yourgoalhere&gt;</tt></p>
+++ <p>When a build is executed in offline mode, maven will look for dependencies or
+++ poms only in your local repository.</p>
    
+++ <p><tt>$mvn -o ...</tt></p>
+++ 
    <h5>show stacktraces</h5>
    
+++ <p>This can be useful for debugging, as maven sometimes masks the originating
+++ exception in its errormessage.</p>
+++ 
    <p><tt>$mvn -e &lt;yourgoalhere&gt;</tt></p>
    
+++ <h2>Useful links</h2>
+++ 
+++ <ul>
+++ <li>Latest snapshots of the maven core<br/>
+++ <a href="http://maven.zones.apache.org/~maven/builds/">http://maven.zones.apache.org/~maven/builds/</a>
+++ </li>
+++ <li>Our repository for putting dependencies that haven't been mavenized yet
+++ <br/>
+++ <a href="http://cvs.apache.org/repository/">http://cvs.apache.org/repository/</a>
+++ </li>
+++ <li>Maven snapshot repository (snapshot versions of maven plugins are often
+++ deployed here)<br/>
+++ <a href="http://snapshots.maven.codehaus.org/maven2/">http://snapshots.maven.codehaus.org/maven2/</a>
+++ </li>
+++ </ul>
+++ 
+++ <h2>The repository structure</h2>
+++ 
+++ <h2>How to do a full cocoon build</h2>
+++ 
+++ <p><tt>$mvn -Dmaven.test.skip=true install</tt></p>
+++ 
+++ <p>This will produce artifacts for all blocks in your local repository.</p>
+++ 
+++ <h2>How to mount the projects in eclipse</h2>
+++ 
+++ <p>From /trunk, run <tt>mvn eclipse:clean</tt> first to remove any left
over
+++ eclipse<br/>
+++ files. Then run <tt>mvn eclipse:eclipse</tt>.</p>
+++ 
+++ <p>Next go to eclipse, and make sure you haven't got trunk mounted as a<br/>
+++ project already. Do File-Import-&gt;Existing projects into workspace, then<br/>
+++ point to your trunk directory and it should detect the newly created<br/>
+++ blocks as projects.</p>
+++ 
+++ <p>Note that you need to declare the M2_REPO classpath variable in your<br/>
+++ workspace, it should point to your local m2 repository.</p>
+++ 
+++ <p>You can also get eclipse to download the sources of the dependent libraries
+++ (if available) and attach them<br/>
+++ to the jars in eclipse :</p>
+++ 
+++ <p><tt>$ mvn -Declipse.downloadSources=true eclipse:eclipse</tt></p>
+++ 
+++ <h2>How to convert an existing block to a maven managed block</h2>
+++ 
+++ <p>For this example to work, you should make sure you have maven 2.0.1 or latest
+++ snapshot installed.</p>
+++ 
+++ <ul>
+++ <li>Use the archetype plugin to create a quick template block structure in the
+++ repo root  (assuming the name of the block you want to create is 
+++ "cocoon-core".<tt><br/>
+++ <br/>
+++ $mvn archetype:create -DgroupId=org.apache.cocoon -DartifactId=cocoon-core<br/>
+++ <br/>
+++ </tt></li>
+++ <li>Remove the src/main/java directory from the newly created structure as this
+++ will be replaced by your own java sources. If you have testsources already then
+++ remove src/main/test/java as well.</li>
+++ <li>
+++ <p><tt>$svn add cocoon-core; svn commit cocoon-core</tt></p>
+++ </li>
+++ <li>
+++ <p>go to cocoon-core and svn move the sources from the old block to
+++ src/main/java, the resources should go to src/main/resources, the test sources
+++ to src/test/java and the test resources to src/test/resources.</p>
+++ </li>
+++ <li>run <tt>$mvn compile</tt> to see if the block compiles ok, adjust
pom if
+++ necessary.</li>
+++ </ul>
+++ 
    <h2>How to add a new dependency to an existing module</h2>
    
    <p>There are two possibilities here : the new dependency is already using maven,
(64 equal lines skipped)


Fields
======
no changes

Links
=====
no changes

Custom Fields
=============
no changes

Collections
===========
no changes

Mime
View raw message