![]() |
Home > Documentation > Reference > Samples > Sample applications > csa-activemq - A demo to assembly a server using car-maven-plugin |
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 car-maven-plugin
to build a custom server assembly for both Jetty and Tomcat.
We will explain the pom.xml
files for Tomcat with ActiveMQ assembly. Likewise, you can apply the similar configurations to Jetty and ActiveMQ assembly.
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.apache.geronimo.samples</groupId> <artifactId>samples</artifactId> <version>2.2</version> </parent> <artifactId>csa-activemq</artifactId> <name>Custom Server Assembly Sample :: ActiveMQ</name> <packaging>pom</packaging> <version>2.2</version> <description> A Sample to demo how to use car-maven-plugin to assemble a server with ActiveMQ </description> <modules> <module>csa-activemq-jetty</module> <module>csa-activemq-tomcat</module> </modules> </project>
In the code above, make sure you specify the module IDs of the project and enclosed ones.
To assemble a working server as we expected, you have to
org.apache.geronimo.framework.plugingroups::framework
in the dependencies;org.apache.geronimo.plugins:activemq-webconsole-tomcat
org.apache.geronimo.configs:activemq-ra
<packaging>server-assembly</packaging>
car-maven-plugin
, such as:
config.xml
config-substitutions.properties
artifact-aliases.properties
client_artifact_aliases.properties
jsr88-configurer-config.xml
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.apache.geronimo.samples</groupId> <artifactId>csa-activemq</artifactId> <version>2.2</version> </parent> <groupId>org.apache.geronimo.samples</groupId> <artifactId>csa-activemq-tomcat</artifactId> <version>2.2</version> <name>Custom Server Assembly Sample :: ActiveMQ for Tomcat</name> <packaging>server-assembly</packaging> <description> A Sample to demo how to use car-maven-plugin to assemble a server with ActiveMQ </description> <dependencies> <dependency> <groupId>org.apache.geronimo.framework.plugingroups</groupId> <artifactId>framework</artifactId> <version>${geronimoVersion}</version> <type>car</type> </dependency> <dependency> <groupId>org.apache.geronimo.configs</groupId> <artifactId>activemq-ra</artifactId> <version>${geronimoVersion}</version> <type>car</type> </dependency> <dependency> <groupId>org.apache.geronimo.plugins</groupId> <artifactId>activemq-webconsole-tomcat</artifactId> <version>${geronimoVersion}</version> <type>car</type> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.geronimo.buildsupport</groupId> <artifactId>car-maven-plugin</artifactId> <configuration> <servers> <serverInstance> <name>default</name> <configFile>var/config/config.xml</configFile> <configSubstitutionsFile>var/config/config-substitutions.properties</configSubstitutionsFile> <configSubstitutionsPrefix>org.apache.geronimo.config.substitution.</configSubstitutionsPrefix> <artifactAliasesFile>var/config/artifact_aliases.properties</artifactAliasesFile> </serverInstance> <serverInstance> <name>client</name> <attributeManagerFrom>default</attributeManagerFrom> <artifactAliasesFile>var/config/client_artifact_aliases.properties</artifactAliasesFile> </serverInstance> <serverInstance> <name>offline</name> <configFile>var/config/offline-deployer-config.xml</configFile> <configSubstitutionsFile>var/config/config-substitutions.properties</configSubstitutionsFile> <configSubstitutionsPrefix>org.apache.geronimo.config.substitution.</configSubstitutionsPrefix> <artifactAliasesFile>var/config/artifact_aliases.properties</artifactAliasesFile> </serverInstance> <serverInstance> <name>jsr88</name> <configFile>var/config/jsr88-configurer-config.xml</configFile> <configSubstitutionsFile>var/config/config-substitutions.properties</configSubstitutionsFile> <configSubstitutionsPrefix>org.apache.geronimo.config.substitution.</configSubstitutionsPrefix> <artifactAliasesFile>var/config/artifact_aliases.properties</artifactAliasesFile> </serverInstance> </servers> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-deploy-plugin</artifactId> <configuration> <skip>true</skip> </configuration> </plugin> </plugins> </build> </project>
When everything is ready, run the following command in root directory of the sample applicaiton. Then you will find the target server in target
directory of each module.
mvn clean install
![]() ![]() |
Privacy Policy - Copyright © 2003-2011, The Apache Software Foundation, Licensed under ASL 2.0. |