cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [DAISY] Created: Cocoon's Mavenization
Date Sun, 23 Oct 2005 20:45:10 GMT
A new document has been created.

Document ID: 756
Branch: main
Language: default
Name: Cocoon's Mavenization
Document Type: Cocoon Document
Created: 10/23/05 8:44:49 PM
Creator (owner): Jorg Heymans
State: publish


Mime type: text/xml
Size: 4132 bytes

<h1>Welcome to Cocoon 2.2's Mavenization Page</h1>

<p>(Note : the maven build of cocoon is hereafter referred to as M10N)</p>


<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
<li>webapp pom is defined</li>
<li>cocoon "master" pom is defined with all modules</li>

<h2>Current Structure</h2>

       <strong>pom.xml  </strong>-&gt; defines all modules <br/>
            <strong>pom.xml  </strong>-&gt; cocoon-core definition<br/>
            <strong>pom.xml</strong>    -&gt; webapp definition<br/>
                          <strong>pom.xml   </strong>-&gt;
block definition

<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.

<h5>compile a module</h5>

<p><tt>$mvn compile</tt></p>

<h5>package a module</h5>

<p><tt>$mvn package</tt></p>

<h5>install a module in the local repository (meaning its definition can be
reused by your other modules)</h5>

<p><tt>$mvn install</tt></p>

<h5>switch-off testing</h5>

<p>maven by default runs tests, use  <tt>-Dmaven.test.skip=true </tt>to

<h5>build offline</h5>

<p><tt>$mvn -o &lt;yourgoalhere&gt;</tt></p>

<h5>show stacktraces</h5>

<p><tt>$mvn -e &lt;yourgoalhere&gt;</tt></p>

<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,
or it is not.</p>

<h3>The new dependency uses maven</h3>

<p>Say you would like to add a dependency to cglib v2.1. From the
<a href="">central repository</a> , you found out that
it's already being deployed there with maven descriptors and everything. All you
need to do at this point is add the following to pom.xml of the module</p>

      &lt;groupId&gt;cglib&lt;/groupId&gt;  ---&gt; corresponds
to the name of
the directory under URL above<br/>
      &lt;artifactId&gt;cglib&lt;/artifactId&gt;   ---&gt; corresponds
to the
subdirectory of the groupId, which in this case is the same<br/>

<p>The next goal execution will trigger a download of this module with all its

<h3>The new dependency doesn't use maven (yet)</h3>

<p>Let us take the example of JDBI recently added by Sylvain. In order to make
it useable for us in the maven build we need to do following steps</p>

<li>go to the directory on minotaur.</li>
<li>create a groupId directory, "jdbi"</li>
<li>create a subdirectory "jars"</li>
<li>copy the jar into this subdirectory, making sure it's named like
&lt;libraryname&gt;-&lt;version&gt;.jar so maven can reference it.</li>
<li>chmod -R 0775 jdbi , so others can make changes later as well.</li>

<p>After this, you can go ahead and add the dependency to your cocoon block</p>

<p><tt> &lt;dependency&gt;<br/>
      &lt;groupId&gt;jdbigroupId&gt;  <br/>
      &lt;artifactId&gt;jdbi&lt;/artifactId&gt;   <br/>
Now package your block again to verify that maven downloads the dependency

<p>Once you find out that the library is listed on ibiblio, you can remove it
from minotaur and adjust pom.xml to the new location.</p>


The document belongs to the following collections: documentation

View raw message