geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Geronimo v3.0 > Adding JARs to the Geronimo repository
Date Fri, 28 Jan 2011 07:55:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2036/9/4/_/styles/combined.css?spaceKey=GMOxDOC30&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/GMOxDOC30/Adding+JARs+to+the+Geronimo+repository">Adding
JARs to the Geronimo repository</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~maojia508">maojia</a>
    </h4>
        <br/>
                         <h4>Changes (9)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-unchanged" >{scrollbar} <br> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">{excerpt}The
server keeps common Java libraries in a repository using the same directory structure and
naming conventions prompted by the [Apache Maven|http://maven.apache.org/|Apache Maven] project.
If your Java EE asset depends on a library that is not already in the repository, you can
update the repository to include the new library from console or using [deployer command|deploy#deploy-Installlibrary],
and define the dependency in your Java EE asset&#39;s deployment plan.{excerpt} In this
section, we&#39;ll show you how to do it via the Admin Console. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">{excerpt}The
server keeps common Java libraries in a repository by using the same directory structure and
naming conventions prompted by the [Apache Maven|http://maven.apache.org/|Apache Maven] project.
If your Java EE asset depends on a library that is not already in the repository, you can
update the repository to include the new library from the administration console or by using
the [deployer command|deploy#deploy-Installlibrary], and define the dependency in your Java
EE asset&#39;s deployment plan.{excerpt} This topic introduces how to add Java libraries
to the Geronimo repository by using the Administration Console. <br></td></tr>
            <tr><td class="diff-unchanged" > <br>{toc} <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >h1. Update the repository with new
library <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >For adding archives or jars to
the <span class="diff-changed-words">repository<span class="diff-added-chars"style="background-color:
#dfd;">,</span></span> the *Repository Viewer* portlet is available by selecting
*Server &gt; Repository* on the *Console Navigation* menu on the left <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">hand</span>
side. The *Repository Viewer* portlet illustrated in the following figure displays the artifacts
installed in the server&#39;s repository. The layout of the repository is the same as
that used by Apache <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">Maven
making</span> <span class="diff-added-words"style="background-color: #dfd;">Maven,
which makes</span> it possible to <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">easily</span>
copy files <span class="diff-changed-words">over<span class="diff-added-chars"style="background-color:
#dfd;"> easily</span>.</span> <br></td></tr>
            <tr><td class="diff-unchanged" > <br>!repositoryViewer.png!
<br> <br></td></tr>
            <tr><td class="diff-changed-lines" >Here are the meaning for each
field on <span class="diff-added-words"style="background-color: #dfd;">the</span>
*Repository Viewer* portlet: <br></td></tr>
            <tr><td class="diff-changed-lines" >* _File_ is <span class="diff-added-words"style="background-color:
#dfd;">the</span> actual location of the archive. <br></td></tr>
            <tr><td class="diff-unchanged" >* _group_ is a group identifier, typically,
the name of the open source project (for example *commons-logging* or *log4j*), or the directory
tree matching the Java package prefix (for example *org/apache/derby*) of the organization
that supplies the library. <br>* _Artifact_ is the file name prefix of the library.
<br></td></tr>
            <tr><td class="diff-changed-lines" >* _Version_ is the version identifier
of the library in the file, allowing the repository to hold multiple versions of the same
library without <span class="diff-changed-words">ambiguity<span class="diff-added-chars"style="background-color:
#dfd;">.</span></span> <br></td></tr>
            <tr><td class="diff-unchanged" >* _Type_ is the type of file, typically,
*jar*. <br> <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >h1. Define the dependency in the deployment
plan <br> <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">In
order to</span> <span class="diff-added-words"style="background-color: #dfd;">To</span>
avoid problems with trying to load the same native library more than once per jvm lifetime,
you need to put <span class="diff-added-words"style="background-color: #dfd;">the</span>
code that loads native libraries (such as many db drivers) into a classloader plugin that
can be shared among all the datasource plugins that need the classes. <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-changed-lines" >To use an artifact in an application,
<span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">let&#39;s</span>
take the first <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">one</span>
<span class="diff-added-words"style="background-color: #dfd;">artifact</span>
from the list as an example, you will need to add a *&lt;dependency&gt;* element under
*&lt;dependencies&gt;* in the *&lt;environment&gt;* element in the application&#39;s
deployment plan. Here is an excerpt of how a deployment plan would look like: <br></td></tr>
            <tr><td class="diff-unchanged" > <br>{code:xml|borderStyle=solid}
<br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >{code} <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >Besides using the <span class="diff-added-words"style="background-color:
#dfd;">administration</span> console to add an archive into <span class="diff-added-words"style="background-color:
#dfd;">the</span> Geronimo repository, you can do the same thing <span class="diff-added-words"style="background-color:
#dfd;">by</span> using <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">command
[{{deploy}}|Deploy#Install-library].</span> <span class="diff-added-words"style="background-color:
#dfd;">the [{{deploy}}|Deploy#Install-library] command.</span> <br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <style type='text/css'>/*<![CDATA[*/
table.ScrollbarTable  {border: none;padding: 3px;width: 100%;padding: 3px;margin: 0px;background-color:
#f0f0f0}
table.ScrollbarTable td.ScrollbarPrevIcon {text-align: center;width: 16px;border: none;}
table.ScrollbarTable td.ScrollbarPrevName {text-align: left;border: none;}
table.ScrollbarTable td.ScrollbarParent {text-align: center;border: none;}
table.ScrollbarTable td.ScrollbarNextName {text-align: right;border: none;}
table.ScrollbarTable td.ScrollbarNextIcon {text-align: center;width: 16px;border: none;}

/*]]>*/</style><div class="Scrollbar"><table class='ScrollbarTable'><tr><td
width='33%' class='ScrollbarPrevName'>&nbsp;</td><td width='33%' class='ScrollbarParent'><sup><a
href="/confluence/display/GMOxDOC30/Configuring+services"><img border='0' align='middle'
src='/confluence/images/icons/up_16.gif' width='8' height='8'></a></sup><a
href="/confluence/display/GMOxDOC30/Configuring+services">Configuring services</a></td><td
width='33%' class='ScrollbarNextName'>&nbsp;<a href="/confluence/display/GMOxDOC30/Configuring+datasource">Configuring
datasource</a></td><td class='ScrollbarNextIcon'><a href="/confluence/display/GMOxDOC30/Configuring+datasource"><img
border='0' align='middle' src='/confluence/images/icons/forwd_16.gif' width='16' height='16'></a></td></tr></table></div>

<p>The server keeps common Java libraries in a repository by using the same directory
structure and naming conventions prompted by the <a href="http://maven.apache.org/" title="Apache
Maven" class="external-link" rel="nofollow">Apache Maven</a> project. If your Java
EE asset depends on a library that is not already in the repository, you can update the repository
to include the new library from the administration console or by using the <a href="/confluence/display/GMOxDOC30/deploy#deploy-deployInstalllibrary">deployer
command</a>, and define the dependency in your Java EE asset's deployment plan. This
topic introduces how to add Java libraries to the Geronimo repository by using the Administration
Console.</p>

<div>
<ul>
    <li><a href='#AddingJARstotheGeronimorepository-Updatetherepositorywithnewlibrary'>Update
the repository with new library</a></li>
    <li><a href='#AddingJARstotheGeronimorepository-Definethedependencyinthedeploymentplan'>Define
the dependency in the deployment plan</a></li>
</ul></div>

<h1><a name="AddingJARstotheGeronimorepository-Updatetherepositorywithnewlibrary"></a>Update
the repository with new library</h1>

<p>For adding archives or jars to the repository, the <b>Repository Viewer</b>
portlet is available by selecting <b>Server &gt; Repository</b> on the <b>Console
Navigation</b> menu on the left side. The <b>Repository Viewer</b> portlet
illustrated in the following figure displays the artifacts installed in the server's repository.
The layout of the repository is the same as that used by Apache Maven, which makes it possible
to copy files over easily.</p>

<p><span class="image-wrap" style=""><img src="/confluence/download/attachments/20645319/repositoryViewer.png?version=1&amp;modificationDate=1203701771000"
style="border: 0px solid black" /></span></p>

<p>Here are the meaning for each field on the <b>Repository Viewer</b> portlet:</p>
<ul>
	<li><em>File</em> is the actual location of the archive.</li>
	<li><em>group</em> is a group identifier, typically, the name of the open
source project (for example <b>commons-logging</b> or <b>log4j</b>),
or the directory tree matching the Java package prefix (for example <b>org/apache/derby</b>)
of the organization that supplies the library.</li>
	<li><em>Artifact</em> is the file name prefix of the library.</li>
	<li><em>Version</em> is the version identifier of the library in the file,
allowing the repository to hold multiple versions of the same library without ambiguity.</li>
	<li><em>Type</em> is the type of file, typically, <b>jar</b>.</li>
</ul>



<h1><a name="AddingJARstotheGeronimorepository-Definethedependencyinthedeploymentplan"></a>Define
the dependency in the deployment plan</h1>

<p>To avoid problems with trying to load the same native library more than once per
jvm lifetime, you need to put the code that loads native libraries (such as many db drivers)
into a classloader plugin that can be shared among all the datasource plugins that need the
classes.</p>

<p>To use an artifact in an application, take the first artifact from the list as an
example, you will need to add a <b>&lt;dependency&gt;</b> element under
<b>&lt;dependencies&gt;</b> in the <b>&lt;environment&gt;</b>
element in the application's deployment plan. Here is an excerpt of how a deployment plan
would look like: </p>

<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeContent
panelContent">
<pre class="code-xml">
    <span class="code-tag">&lt;environment&gt;</span>
        ...
        <span class="code-tag">&lt;dependencies&gt;</span>
            ...
            <span class="code-tag">&lt;dependency&gt;</span>
                <span class="code-tag">&lt;groupId&gt;</span>annogen<span
class="code-tag">&lt;/groupId&gt;</span>
                <span class="code-tag">&lt;artifactId&gt;</span>annogen<span
class="code-tag">&lt;/artifactId&gt;</span>
                <span class="code-tag">&lt;version&gt;</span>0.1.0<span
class="code-tag">&lt;/version&gt;</span>
                <span class="code-tag">&lt;type&gt;</span>jar<span
class="code-tag">&lt;/type&gt;</span>
            <span class="code-tag">&lt;/dependency&gt;</span>
       <span class="code-tag">&lt;/dependencies&gt;</span>
    <span class="code-tag">&lt;/environment&gt;</span>
</pre>
</div></div>

<p>Besides using the administration console to add an archive into the Geronimo repository,
you can do the same thing by using the <a href="/confluence/display/GMOxDOC30/deploy#deploy-Installlibrary"><tt>deploy</tt></a>
command.</p>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/GMOxDOC30/Adding+JARs+to+the+Geronimo+repository">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=20645319&revisedVersion=2&originalVersion=1">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/GMOxDOC30/Adding+JARs+to+the+Geronimo+repository?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message