geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Geronimo v2.2 > csa-activemq - A demo to assembly a server using car-maven-plugin
Date Mon, 01 Feb 2010 08:11:00 GMT
<html>
<head>
    <base href="http://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=GMOxDOC22&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background-color: white" bgcolor="white">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
     <h2><a href="http://cwiki.apache.org/confluence/display/GMOxDOC22/csa-activemq+-+A+demo+to+assembly+a+server+using+car-maven-plugin">csa-activemq
- A demo to assembly a server using car-maven-plugin</a></h2>
     <h4>Page <b>edited</b> by             <a href="http://cwiki.apache.org/confluence/display/~chirunhua@gmail.com">Runhua
Chi</a>
    </h4>
     
          <br/>
     <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
class='ScrollbarPrevIcon'><a href="/confluence/display/GMOxDOC22/calculator-+Using+EJB+3.0+Functions"><img
border='0' align='middle' src='/confluence/images/icons/back_16.gif' width='16' height='16'></a></td><td
width='33%' class='ScrollbarPrevName'><a href="/confluence/display/GMOxDOC22/calculator-+Using+EJB+3.0+Functions">calculator-
Using EJB 3.0 Functions</a>&nbsp;</td><td width='33%' class='ScrollbarParent'><sup><a
href="/confluence/display/GMOxDOC22/Sample+applications"><img border='0' align='middle'
src='/confluence/images/icons/up_16.gif' width='8' height='8'></a></sup><a
href="/confluence/display/GMOxDOC22/Sample+applications">Sample applications</a></td><td
width='33%' class='ScrollbarNextName'>&nbsp;<a href="/confluence/display/GMOxDOC22/Customer+Simple+ejb+application+with+a+JPA+entity">Customer
Simple ejb application with a JPA entity</a></td><td class='ScrollbarNextIcon'><a
href="/confluence/display/GMOxDOC22/Customer+Simple+ejb+application+with+a+JPA+entity"><img
border='0' align='middle' src='/confluence/images/icons/forwd_16.gif' width='16' height='16'></a></td></tr></table></div>
<p>This sample is used to assemble geronimo integrated ActiveMQ modules(including the
new Geronimo plugin activemq-webconsole), so that user can use it as a standalone JMS server
with user-friendly web interfaces to manage JMS objects. In this sample, we will demonstrate
how to use <tt>car-maven-plugin</tt> to build a custom server assembly for both
Jetty and Tomcat.</p>

<p>We will explain the <tt>pom.xml</tt> files for Tomcat with ActiveMQ assembly.
Likewise, you can apply the similar configurations with Jetty and ActiveMQ assembly. </p>

<h1><a name="csa-activemq-Ademotoassemblyaserverusingcar-maven-plugin-rootpom.xmlofthesample"></a>root
pom.xml of the sample</h1>
<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader"
style="border-bottom-width: 1px;"><b>pom.xml</b></div><div class="codeContent
panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;?xml version=<span class="code-quote">"1.0"</span>
encoding=<span class="code-quote">"UTF-8"</span>?&gt;</span>
&lt;project xmlns=<span class="code-quote">"http://maven.apache.org/POM/4.0.0"</span>
<span class="code-keyword">xmlns:xsi</span>=<span class="code-quote">"http://www.w3.org/2001/XMLSchema-instance"</span>

         xsi:schemaLocation=<span class="code-quote">"http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd"</span>&gt;
    
    <span class="code-tag">&lt;modelVersion&gt;</span>4.0.0<span class="code-tag">&lt;/modelVersion&gt;</span>
    
    <span class="code-tag">&lt;parent&gt;</span>
        <span class="code-tag">&lt;groupId&gt;</span>org.apache.geronimo.samples<span
class="code-tag">&lt;/groupId&gt;</span>
        <span class="code-tag">&lt;artifactId&gt;</span>samples<span
class="code-tag">&lt;/artifactId&gt;</span>
        <span class="code-tag">&lt;version&gt;</span>2.2<span class="code-tag">&lt;/version&gt;</span>
    <span class="code-tag">&lt;/parent&gt;</span>
    
    <span class="code-tag">&lt;artifactId&gt;</span>csa-activemq<span
class="code-tag">&lt;/artifactId&gt;</span>
    <span class="code-tag">&lt;name&gt;</span>Custom Server Assembly Sample
:: ActiveMQ<span class="code-tag">&lt;/name&gt;</span>
    <span class="code-tag">&lt;packaging&gt;</span>pom<span class="code-tag">&lt;/packaging&gt;</span>
    <span class="code-tag">&lt;version&gt;</span>2.2<span class="code-tag">&lt;/version&gt;</span>
    
    <span class="code-tag">&lt;description&gt;</span>
        A Sample to demo how to use car-maven-plugin to assemble a server with ActiveMQ
    <span class="code-tag">&lt;/description&gt;</span>
    
   <span class="code-tag">&lt;modules&gt;</span>
        <span class="code-tag">&lt;module&gt;</span>csa-activemq-jetty<span
class="code-tag">&lt;/module&gt;</span>        
        <span class="code-tag">&lt;module&gt;</span>csa-activemq-tomcat<span
class="code-tag">&lt;/module&gt;</span>        
   <span class="code-tag">&lt;/modules&gt;</span>   
<span class="code-tag">&lt;/project&gt;</span>
</pre>
</div></div>

<p>In the code above, make sure you specify the module IDs of the project and enclosed
ones.</p>

<h1><a name="csa-activemq-Ademotoassemblyaserverusingcar-maven-plugin-pom.xmlforTomcatandActiveMQassembly"></a>pom.xml
for Tomcat and ActiveMQ assembly</h1>

<p>To assemble a working server as we expected, you have to</p>
<ol>
	<li>Include <tt>org.apache.geronimo.framework.plugingroups::framework</tt>
in the dependencies;</li>
	<li>Include other required modules, such as
	<ul>
		<li><tt>org.apache.geronimo.plugins:activemq-webconsole-tomcat</tt></li>
		<li><tt>org.apache.geronimo.configs:activemq-ra</tt></li>
	</ul>
	</li>
	<li>Specify you are going to assemble a new server with element <tt>&lt;packaging&gt;server-assembly&lt;/packaging&gt;</tt></li>
	<li>Make sure all configuration files required by a running server wired to <tt>car-maven-plugin</tt>,
such as:
	<ul>
		<li><tt>config.xml</tt></li>
		<li><tt>config-substitutions.properties</tt></li>
		<li><tt>artifact-aliases.properties</tt></li>
		<li><tt>client_artifact_aliases.properties</tt></li>
		<li><tt>jsr88-configurer-config.xml</tt></li>
	</ul>
	</li>
</ol>


<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;?xml version=<span class="code-quote">"1.0"</span>
encoding=<span class="code-quote">"UTF-8"</span>?&gt;</span>
&lt;project xmlns=<span class="code-quote">"http://maven.apache.org/POM/4.0.0"</span>
<span class="code-keyword">xmlns:xsi</span>=<span class="code-quote">"http://www.w3.org/2001/XMLSchema-instance"</span>

         xsi:schemaLocation=<span class="code-quote">"http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd"</span>&gt;
    
    <span class="code-tag">&lt;modelVersion&gt;</span>4.0.0<span class="code-tag">&lt;/modelVersion&gt;</span>
    
    <span class="code-tag">&lt;parent&gt;</span>
        <span class="code-tag">&lt;groupId&gt;</span>org.apache.geronimo.samples<span
class="code-tag">&lt;/groupId&gt;</span>
        <span class="code-tag">&lt;artifactId&gt;</span>csa-activemq<span
class="code-tag">&lt;/artifactId&gt;</span>
        <span class="code-tag">&lt;version&gt;</span>2.2<span class="code-tag">&lt;/version&gt;</span>
    <span class="code-tag">&lt;/parent&gt;</span>

    <span class="code-tag">&lt;groupId&gt;</span>org.apache.geronimo.samples<span
class="code-tag">&lt;/groupId&gt;</span>
    <span class="code-tag">&lt;artifactId&gt;</span>csa-activemq-tomcat<span
class="code-tag">&lt;/artifactId&gt;</span>
    <span class="code-tag">&lt;version&gt;</span>2.2<span class="code-tag">&lt;/version&gt;</span>
    <span class="code-tag">&lt;name&gt;</span>Custom Server Assembly Sample
:: ActiveMQ for Tomcat<span class="code-tag">&lt;/name&gt;</span>
    <span class="code-tag">&lt;packaging&gt;</span>server-assembly<span
class="code-tag">&lt;/packaging&gt;</span>
    
    <span class="code-tag">&lt;description&gt;</span>
        A Sample to demo how to use car-maven-plugin to assemble a server with ActiveMQ
    <span class="code-tag">&lt;/description&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>org.apache.geronimo.framework.plugingroups<span
class="code-tag">&lt;/groupId&gt;</span>
            <span class="code-tag">&lt;artifactId&gt;</span>framework<span
class="code-tag">&lt;/artifactId&gt;</span>
            <span class="code-tag">&lt;version&gt;</span>${geronimoVersion}<span
class="code-tag">&lt;/version&gt;</span>
            <span class="code-tag">&lt;type&gt;</span>car<span class="code-tag">&lt;/type&gt;</span>
        <span class="code-tag">&lt;/dependency&gt;</span>
	<span class="code-tag">&lt;dependency&gt;</span>
            <span class="code-tag">&lt;groupId&gt;</span>org.apache.geronimo.configs<span
class="code-tag">&lt;/groupId&gt;</span>
            <span class="code-tag">&lt;artifactId&gt;</span>activemq-ra<span
class="code-tag">&lt;/artifactId&gt;</span>
            <span class="code-tag">&lt;version&gt;</span>${geronimoVersion}<span
class="code-tag">&lt;/version&gt;</span>
            <span class="code-tag">&lt;type&gt;</span>car<span class="code-tag">&lt;/type&gt;</span>
        <span class="code-tag">&lt;/dependency&gt;</span>
	<span class="code-tag">&lt;dependency&gt;</span>
            <span class="code-tag">&lt;groupId&gt;</span>org.apache.geronimo.plugins<span
class="code-tag">&lt;/groupId&gt;</span>
            <span class="code-tag">&lt;artifactId&gt;</span>activemq-webconsole-tomcat<span
class="code-tag">&lt;/artifactId&gt;</span>
            <span class="code-tag">&lt;version&gt;</span>${geronimoVersion}<span
class="code-tag">&lt;/version&gt;</span>
            <span class="code-tag">&lt;type&gt;</span>car<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;build&gt;</span>
        <span class="code-tag">&lt;plugins&gt;</span>
            <span class="code-tag">&lt;plugin&gt;</span>
                <span class="code-tag">&lt;groupId&gt;</span>org.apache.geronimo.buildsupport<span
class="code-tag">&lt;/groupId&gt;</span>
                <span class="code-tag">&lt;artifactId&gt;</span>car-maven-plugin<span
class="code-tag">&lt;/artifactId&gt;</span>
                <span class="code-tag">&lt;configuration&gt;</span>
                    <span class="code-tag">&lt;servers&gt;</span>
                        <span class="code-tag">&lt;serverInstance&gt;</span>
                            <span class="code-tag">&lt;name&gt;</span>default<span
class="code-tag">&lt;/name&gt;</span>
                            <span class="code-tag">&lt;configFile&gt;</span>var/config/config.xml<span
class="code-tag">&lt;/configFile&gt;</span>
                            <span class="code-tag">&lt;configSubstitutionsFile&gt;</span>var/config/config-substitutions.properties<span
class="code-tag">&lt;/configSubstitutionsFile&gt;</span>
                            <span class="code-tag">&lt;configSubstitutionsPrefix&gt;</span>org.apache.geronimo.config.substitution.<span
class="code-tag">&lt;/configSubstitutionsPrefix&gt;</span>
                            <span class="code-tag">&lt;artifactAliasesFile&gt;</span>var/config/artifact_aliases.properties<span
class="code-tag">&lt;/artifactAliasesFile&gt;</span>
                        <span class="code-tag">&lt;/serverInstance&gt;</span>
                        <span class="code-tag">&lt;serverInstance&gt;</span>
                            <span class="code-tag">&lt;name&gt;</span>client<span
class="code-tag">&lt;/name&gt;</span>
                            <span class="code-tag">&lt;attributeManagerFrom&gt;</span>default<span
class="code-tag">&lt;/attributeManagerFrom&gt;</span>
                            <span class="code-tag">&lt;artifactAliasesFile&gt;</span>var/config/client_artifact_aliases.properties<span
class="code-tag">&lt;/artifactAliasesFile&gt;</span>
                        <span class="code-tag">&lt;/serverInstance&gt;</span>
                        <span class="code-tag">&lt;serverInstance&gt;</span>
                            <span class="code-tag">&lt;name&gt;</span>offline<span
class="code-tag">&lt;/name&gt;</span>
                            <span class="code-tag">&lt;configFile&gt;</span>var/config/offline-deployer-config.xml<span
class="code-tag">&lt;/configFile&gt;</span>
                            <span class="code-tag">&lt;configSubstitutionsFile&gt;</span>var/config/config-substitutions.properties<span
class="code-tag">&lt;/configSubstitutionsFile&gt;</span>
                            <span class="code-tag">&lt;configSubstitutionsPrefix&gt;</span>org.apache.geronimo.config.substitution.<span
class="code-tag">&lt;/configSubstitutionsPrefix&gt;</span>
                            <span class="code-tag">&lt;artifactAliasesFile&gt;</span>var/config/artifact_aliases.properties<span
class="code-tag">&lt;/artifactAliasesFile&gt;</span>
                        <span class="code-tag">&lt;/serverInstance&gt;</span>
                        <span class="code-tag">&lt;serverInstance&gt;</span>
                            <span class="code-tag">&lt;name&gt;</span>jsr88<span
class="code-tag">&lt;/name&gt;</span>
                            <span class="code-tag">&lt;configFile&gt;</span>var/config/jsr88-configurer-config.xml<span
class="code-tag">&lt;/configFile&gt;</span>
                            <span class="code-tag">&lt;configSubstitutionsFile&gt;</span>var/config/config-substitutions.properties<span
class="code-tag">&lt;/configSubstitutionsFile&gt;</span>
                            <span class="code-tag">&lt;configSubstitutionsPrefix&gt;</span>org.apache.geronimo.config.substitution.<span
class="code-tag">&lt;/configSubstitutionsPrefix&gt;</span>
                            <span class="code-tag">&lt;artifactAliasesFile&gt;</span>var/config/artifact_aliases.properties<span
class="code-tag">&lt;/artifactAliasesFile&gt;</span>
                        <span class="code-tag">&lt;/serverInstance&gt;</span>
                    <span class="code-tag">&lt;/servers&gt;</span>
                <span class="code-tag">&lt;/configuration&gt;</span>
            <span class="code-tag">&lt;/plugin&gt;</span>
	  <span class="code-tag">&lt;plugin&gt;</span>            
            <span class="code-tag">&lt;groupId&gt;</span>org.apache.maven.plugins<span
class="code-tag">&lt;/groupId&gt;</span>
            <span class="code-tag">&lt;artifactId&gt;</span>maven-deploy-plugin<span
class="code-tag">&lt;/artifactId&gt;</span>
            <span class="code-tag">&lt;configuration&gt;</span>
              <span class="code-tag">&lt;skip&gt;</span>true<span class="code-tag">&lt;/skip&gt;</span>
            <span class="code-tag">&lt;/configuration&gt;</span>
          <span class="code-tag">&lt;/plugin&gt;</span>
        <span class="code-tag">&lt;/plugins&gt;</span>
    <span class="code-tag">&lt;/build&gt;</span>
<span class="code-tag">&lt;/project&gt;</span>
</pre>
</div></div>

<h1><a name="csa-activemq-Ademotoassemblyaserverusingcar-maven-plugin-Assembletheserverusingmavencommand"></a>Assemble
the server using maven command</h1>

<p>When everything is ready, run the following command in root directory of the sample
applicaiton. Then you will find the target server in <tt>target</tt> directory
of each module.</p>
<div class="panel" style="border-width: 1px;"><div class="panelContent">
<p>mvn clean install</p>
</div></div>
     </div>
     <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
       </div>

       <a href="http://cwiki.apache.org/confluence/display/GMOxDOC22/csa-activemq+-+A+demo+to+assembly+a+server+using+car-maven-plugin">View
Online</a>
       |
       <a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=12845313&revisedVersion=3&originalVersion=2">View
Change</a>
              |
       <a href="http://cwiki.apache.org/confluence/display/GMOxDOC22/csa-activemq+-+A+demo+to+assembly+a+server+using+car-maven-plugin?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message