Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Deploying applications with the command line deployer or through the administration console is fine for experiments but does not fit well into an automated development workflow. The Geronimo plugin system lets you set up a workflow using maven that builds your applications, pre-deploys them as geronimo plugins, and assembles a server containing the plugins needed to run your applications. Further workflow steps could include automated testing by starting the custom server and running e.g. selenium tests against it.

In order to simplify setting up such an automated workflow we provide maven archetypes to help with setting up maven projects to build plugins and assemble servers. As an example we'll describe setting up such a workflow for the liferay 4.4.1 portal. Note that this is two steps removed from a description of how to deploy liferay on geronimo, and one step removed from a description of how to build plugins for the liferay portal. For a completed example of such a workflow see the roller plugins at https://svn.apache.org/

It's now easy to assemble a special purpose server as part of your maven build. As an example we'll show how to take a fairly large existing application, the liferay 4.4.1 portal, and construct a custom server that runs it. We'll use the maven archetypes to construct most of the maven projects.

For a completed example see the roller plugins at https://svn.apache.org/repos/asf/geronimo/plugins/roller/trunk

...

Code Block
mvn install:install-file \
  -Dfile=liferay-portal-4.4.1.war \
  -DgroupId=com.liferay \
  -DartifactId=liferay-portal \
  -Dversion=4.4.1 \
  -Dpackaging=war

mvn install:install-file \
  -Dfile=liferay-portal-dependencies-4.4.1/portal-kernel.jar \
  -DgroupId=com.liferay \
  -DartifactId=portal-kernel \
  -Dversion=4.4.1 \
  -Dpackaging=jar

mvn install:install-file \
  -Dfile=liferay-portal-dependencies-4.4.1/portal-service.jar \
  -DgroupId=com.liferay \
  -DartifactId=portal-service \
  -Dversion=4.4.1 \
  -Dpackaging=jar

Set up a parent maven project

...

Code Block
mvn archetype:create \
  -DarchetypeGroupId=org.apache.maven.archetypes \
  -DarchetypeArtifactId=maven-archetype-quickstart \
  -DarchetypeVersion=1.0 \
  -DgroupId=org.apache.geronimo.plugins \
  -DartifactId=liferay-parent \
  -Dversion=1.0-SNAPSHOT

cd liferay-parent
rm -rf src

...

Repackage the liferay war

(not done yet)

...

The JEE spec tells us to package jars used by an application in with the application in WEB-INF/lib or lib directories. This may appear to make the application more self contained but it can produce a tracking nightmare as it becomes more difficult to determine exactly what is in these directories, what version is being used, etc etc, not to mention promoting duplication of code used by several projects. Geronimo instead lets you put your jars in the maven-structured geronimo repository and specify the classloader structure for your apps to include these jars where necessary. If you want to convert an existing war project to this repository-based classloader solution you probably need to remove some of the jars from the existing war. You can do this easily with maven war overlays. For each jar you want to use from the geronimo repository, you specify an exclude in the overlay configuration and add the jar as a dependency in the maven project that builds the geronimo plugin. This example only excludes a few jars, most of which are already present in the parent classloader.

Code Block

mvn archetype:create \
  -DarchetypeGroupId=org.apache.maven.archetypes \
  -DarchetypeArtifactId=maven-archetype-webapp \
  -DarchetypeVersion=1.0 \
  -DgroupId=com.liferay \
  -DartifactId=liferay-portal-lesslibs \
  -Dversion=4.4.1-NOLIB-SNAPSHOT
cd liferay-portal
rm -rf src

Modify the pom.xml to include the liferay war dependency

Code Block

        <dependency>
            <groupId>com.liferay</groupId>
            <artifactId>liferay-portal</artifactId>
            <version>${liferayVersion}</version>
            <type>war</type>
	</dependency>

and configure the war plugin with an overlay descriptor:

Code Block

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.1-alpha-1</version>
                <configuration>
                    <overlays>
                        <overlay>
                            <id>liferay</id>
                            <groupId>com.liferay</groupId>
                            <artifactId>liferay-portal</artifactId>
                            <excludes>
                                <exclude>WEB-INF/classes/log4j.properties</exclude>
                                <exclude>WEB-INF/geronimo-web.xml</exclude>
                                <exclude>WEB-INF/jboss-web.xml</exclude>
                                <exclude>WEB-INF/jonas-web.xml</exclude>
                                <exclude>WEB-INF/jrun-web.xml</exclude>
                                <exclude>WEB-INF/resin-web.xml</exclude>
                                <exclude>WEB-INF/sun-web.xml</exclude>

                                <!-- use geronimo dependencies rather than inclusion for published artifacts -->
                                <exclude>WEB-INF/lib/activemq.jar</exclude>
                                <exclude>WEB-INF/lib/commons-digester.jar</exclude>
                                <!-- other excludes are supplied by geronimo anyway -->
                                <exclude>WEB-INF/lib/cglib.jar</exclude>
                                <exclude>WEB-INF/lib/commons-logging..jar</exclude>
                                <exclude>WEB-INF/lib/j2ee-management.jar</exclude>
                                <exclude>WEB-INF/lib/jmx-remote.jar</exclude>
                                <exclude>WEB-INF/lib/jmx-ri.jar</exclude>
                                <exclude>WEB-INF/lib/log4j.jar</exclude>
                                <exclude>WEB-INF/lib/mx4j.jar</exclude>
                            </excludes>
                        </overlay>
                    </overlays>
                </configuration>
            </plugin>
        </plugins>

    </build>

Build a database plugin

in liferay-parent run

Code Block

mvn archetype:create \
  -DarchetypeGroupId=org.apache.geronimo.buildsupport \
  -DarchetypeArtifactId=geronimo-module-archetype \
  -DarchetypeVersion=2.2-SNAPSHOT \
  -DgroupId=org.apache.geronimo.plugins \
  -DartifactId=liferay-derby \
  -Dversion=1.0-SNAPSHOT

Change the plan so it looks like this:

Code Block

<?xml version="1.0" encoding="UTF-8"?>

<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2">
    <resourceadapter>
        <outbound-resourceadapter>
            <connection-definition>
                <connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
                <connectiondefinition-instance>
                    <name>jdbc/LiferayPool</name>
                    <config-property-setting name="Password">liferay</config-property-setting>
                    <config-property-setting name="UserName">liferay</config-property-setting>
                    <config-property-setting name="DatabaseName">liferay</config-property-setting>
                    <connectionmanager>
                        <local-transaction/>
                

Build a database plugin

in liferay-parent run

Code Block

mvn archetype:create -DarchetypeGroupId=org.apache.geronimo.buildsupport -DarchetypeArtifactId=geronimo-module-archetype -DarchetypeVersion=2.2-SNAPSHOT -DgroupId=org.apache.geronimo.plugins -DartifactId=liferay-derby -Dversion=1.0-SNAPSHOT

Change the plan so it looks like this:

Code Block

<?xml version="1.0" encoding="UTF-8"?>

<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2">
    <resourceadapter>
        <outbound<single-resourceadapter>pool>
            <connection-definition>
                <connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
<max-size>10</max-size>
                            <connectiondefinition-instance>
<min-size>0</min-size>
                            <match-one/>
    <name>jdbc/LiferayPool</name>
                    <config-property-setting name="Password">liferay</config-property-setting></single-pool>
                    <config-property-setting name="UserName">liferay</config-property-setting>
</connectionmanager>
                </connectiondefinition-instance>
<!-- Leave until we figure out if <config-property-setting name="DatabaseName">liferay</config-property-setting>
   non-jta datasource is needed -->
<!--
                 <connectionmanager><connectiondefinition-instance>
                        <local-transaction/><name>jdbc/NoTxrollerdb</name>
                    <config-property-setting name="Password">roller</config-property-setting>
   <single-pool>
                 <config-property-setting name="UserName">roller</config-property-setting>
          <max-size>10</max-size>
          <config-property-setting name="DatabaseName">roller</config-property-setting>
                 <min-size>0</min-size>
   <connectionmanager>
                         <match<no-onetransaction/>
                        </single<single-pool>
                     </connectionmanager>
       <max-size>10</max-size>
         </connectiondefinition-instance>
<!-- Leave until we figure out if non-jta datasource is needed -->
<!--
        <min-size>0</min-size>
        <connectiondefinition-instance>
                    <name>jdbc/NoTxrollerdb</name>
     <match-one/>
               <config-property-setting name="Password">roller</config-property-setting>
         </single-pool>
              <config-property-setting name="UserName">roller</config-property-setting>
     </connectionmanager>
               <config-property-setting name="DatabaseName">roller</config-property-setting>
 </connectiondefinition-instance>
-->
            </connection-definition>
        </outbound-resourceadapter>
    <connectionmanager></resourceadapter>

</connector>

and modify the pom setting the geronimoVersion to 2.1 and with

Code Block
    <dependencies>
        <!-- if you are deploying a jee application, use scope provided  <no--transaction/>
        <dependency>
                <single-pool><groupId>org.tranql</groupId>
                            <max-size>10</max-size><artifactId>tranql-connector-derby-embed-local</artifactId>
                            <min-size>0</min-size>
<version>1.4</version>
            <type>rar</type>
            <scope>provided</scope>
        <match-one/></dependency>

        <!-- other dependencies will normally end up as dependencies in the plan and    </single-pool>geronimo-plugin.xml -->
        <dependency>
            </connectionmanager><groupId>org.apache.geronimo.configs</groupId>
            <artifactId>system-database</artifactId>
    </connectiondefinition-instance>
-->
        <type>car</type>
    </connection-definition>
        <version>${geronimoVersion}</outbound-resourceadapter>version>
    </resourceadapter>

</connector>

and modify the pom setting the geronimoVersion to 2.1 and with

Code Block

    <dependencies></dependency>

        <!-- ifinclude youdependencies areon deployingall adeployer jeemodules applicationneeded, usewith scope provided -->
        <dependency>
            <groupId>org.apache.geronimo.tranql<configs</groupId>
            <artifactId>tranql-connector-derby-embed-local</artifactId><artifactId>connector-deployer</artifactId>
            <type>car</type>
            <version>${geronimoVersion}</version>
        </dependency>

    <version>1.4</version></dependencies>

and

Code Block
            <type>rar</type>
<plugin>
                <scope>provided</scope><groupId>org.apache.geronimo.buildsupport</groupId>
        </dependency>

        <!<artifactId>car-maven-plugin</artifactId>
   other dependencies will normally end up as dependencies in the plan and geronimo-plugin.xml --> <configuration>
        <dependency>
            <groupId>org.apache.geronimo.configs</groupId>
<deploymentConfigs>
              <artifactId>system-database</artifactId>
          <!-- gbean <type>car</type>
deployer is default.  For jee apps include all deployers your  <version>${geronimoVersion}</version>
   app needs, see properties -->
     </dependency>

        <!-- include dependencies on all deployer modules needed, with scope provided -->
 <deploymentConfig>${gbeanDeployer}</deploymentConfig>
          <dependency>
            <groupId>org.apache.geronimo.configs</groupId>
      <deploymentConfig>${connectorDeployer}</deploymentConfig>
        <artifactId>connector-deployer</artifactId>
            <type>car<</type>deploymentConfigs>
            <version>${geronimoVersion}</version>
        </dependency>

    </dependencies>

and

Code Block

     !-- if you are deploying a jee app specify it here -->
       <plugin>
             <module>
   <groupId>org.apache.geronimo.buildsupport</groupId>
                <artifactId>car-maven-plugin</artifactId>
     <groupId>org.tranql</groupId>
           <configuration>
             <artifactId>tranql-connector-derby-embed-local</artifactId>
       <deploymentConfigs>
                 <type>rar</type>
       <!-- gbean deployer is default.  For jee apps include all deployers your app needs, see properties -->
</module>
                    <!-- Normally you can use the maven  <deploymentConfig>${gbeanDeployer}</deploymentConfig>
dependencies unaltered.  If you need to specify import scope
                <deploymentConfig>${connectorDeployer}</deploymentConfig>
     you can list the dependencies here as you want them in the    </deploymentConfigs>plan.xml -->
                    <!-- if you are deploying a jee app specify it here -->
<useMavenDependencies>
                        <value>true</value>
        <module>
                <includeVersion>true</includeVersion>
        <groupId>org.tranql</groupId>
            </useMavenDependencies>
            <artifactId>tranql-connector-derby-embed-local</artifactId>
        <!-- the instance sets up most of the optional geronimo-plugin.xml content -->
     <type>rar</type>
               <instance>
     </module>
                    <!-- Normally you can use the maven dependencies unaltered.  If you need to specify import scope
<plugin-artifact>
                        </plugin-artifact>
              you  can list the dependencies here</instance>
 as you want them in the plan.xml -->
        </configuration>
            <useMavenDependencies>
                        <value>true</value></plugin>

Build the liferay war plugin

run

Code Block

mvn archetype:create \
  -DarchetypeGroupId=org.apache.geronimo.buildsupport \
  -DarchetypeArtifactId=geronimo-module-archetype \
  -DarchetypeVersion=2.2-SNAPSHOT \
  -DgroupId=org.apache.geronimo.plugins \
  -DartifactId=liferay-jetty \
  -Dversion=1.0-SNAPSHOT

Edit the plan so it looks like:
NOTE: this is derived from the liferay plan at and is under the liferay (MIT) license

Code Block

<?xml version="1.0"?>

<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1">

    <environment>
                    <includeVersion>true</includeVersion>
                <inverse-classloading/>
    </useMavenDependencies>
                    <!-- the instance sets up most of the optional geronimo-plugin.xml content -->
                    <instance>
    environment>

	<context-root>${LiferayContextPath}</context-root>
	<security-realm-name>PortalRealm</security-realm-name>
      <security use-context-handler="false" xmlns="http://geronimo.apache.org/xml/ns/security-2.0">
<!-- requires security to be set up for default subject
        <default-subject>
          <realm>PortalRealm</realm>
  <plugin-artifact>
        <id>default</id>
        </default-subject>
-->
        </plugin<role-artifact>mappings>
          <role role-name="users">
         </instance>
     <principal class="com.liferay.portal.security.jaas.PortalRole" name="users" />
          </configuration>role>
        </role-mappings>
      </plugin>

Build the liferay war plugin

run

Code Block

mvn archetype:create -DarchetypeGroupId=org.apache.geronimo.buildsupport -DarchetypeArtifactId=geronimo-module-archetype -DarchetypeVersion=2.2-SNAPSHOT -DgroupId=</security>

    <gbean name="CredentialStore" class="org.apache.geronimo.plugins -DartifactId=liferay-jetty -Dversion=1.0-SNAPSHOT

Edit the plan so it looks like:
NOTE: this is derived from the liferay plan at and is under the liferay (MIT) license

Code Block

<?xml version="1.0"?>

<web-appsecurity.credentialstore.SimpleCredentialStoreImpl">
        <xml-attribute name="credentialStore">
            <credential-store xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1">

credentialstore-1.0">
                <realm name="PortalRealm">
                    <subject>
            <environment>
        <inverse-classloading/>
    <<id>default</environment>

	<context-root>${LiferayContextPath}</context-root>
	<security-realm-name>PortalRealm</security-realm-name>
id>
<!-- you will have so set up the backing store appropriately -->
                      <security use-context-handler="false" xmlns="http://geronimo.apache.org/xml/ns/security-2.0">
<!-- requires security to be set up for default subject
 <credential>
                  <default-subject>
          <realm>PortalRealm</realm>
<type>org.apache.geronimo.security.credentialstore.NameCallbackHandler</type>
                   <id>default</id>
         <value>anonymous</value>
         </default-subject>
-->
         <role-mappings>
      </credential>
    <role role-name="users">
              <principal class="com.liferay.portal.security.jaas.PortalRole" name="users" />
  <credential>
        </role>
        </role-mappings>
      </security>

    <gbean name="CredentialStore" class="org <type>org.apache.geronimo.security.credentialstore.SimpleCredentialStoreImpl">
PasswordCallbackHandler</type>
              <xml-attribute name="credentialStore">
            <credential-store xmlns="http://geronimo.apache.org/xml/ns/credentialstore-1.0"> <value>anonymous</value>
                <realm name="PortalRealm">
        </credential>
            <subject>
        </subject>
                <id>default<</id>
<!-- you will have so set up the backing store appropriately -->realm>
            </credential-store>
        </xml-attribute>
          <dependency>
      <credential>
      <name>PortalRealm</name>
        </dependency>
    </gbean>



	<gbean name="PortalRealm" class="org.apache.geronimo.security.realm.GenericSecurityRealm">
		<attribute name="realmName">PortalRealm</attribute>
		<reference       <type>org.apache.geronimo.security.credentialstore.NameCallbackHandler</type>
                            <value>anonymous</value>
                        </credential>
                        <credential>
                            <type>org.apache.geronimo.security.credentialstore.PasswordCallbackHandler</type>
                            <value>anonymous</value>
                        </credential>
                    </subject>
                </realm>
            </credential-store>
        </xml-attribute>
        <dependency>name="ServerInfo">
			<name>ServerInfo</name>
		</reference>
		<xml-reference name="LoginModuleConfiguration">
			<log:login-config xmlns:log="http://geronimo.apache.org/xml/ns/loginconfig-2.0">
				<log:login-module control-flag="REQUIRED" wrap-principals="false">
					<log:login-domain-name>PortalDomain</log:login-domain-name>
					<log:login-module-class>com.liferay.portal.security.jaas.ext.tomcat.PortalLoginModule</log:login-module-class>
				</log:login-module>
			</log:login-config>
		</xml-reference>
	</gbean>
</web-app>

and the pom to have geronimoVersion 2.1, liferayVersion 4.4.1 and include

Code Block

    <dependencies>
            <name>PortalRealm</name>
        </dependency>
    </gbean>



	<gbean name="PortalRealm" class="org.apache.geronimo.security.realm.GenericSecurityRealm">
		<attribute name="realmName">PortalRealm</attribute>
		<reference name="ServerInfo">
			<name>ServerInfo</name>
		</reference>
		<xml-reference name="LoginModuleConfiguration">
			<log:login-config xmlns:log="http://geronimo.apache.org/xml/ns/loginconfig-2.0">
				<log:login-module control-flag="REQUIRED" wrap-principals="false">
					<log:login-domain-name>PortalDomain</log:login-domain-name>
					<log:login-module-class>com.liferay.portal.security.jaas.ext.tomcat.PortalLoginModule</log:login-module-class>
				</log:login-module>
			</log:login-config>
		</xml-reference>
	</gbean>
</web-app>

and the pom to have geronimoVersion 2.1, liferayVersion 4.4.1 and include

Code Block

    <dependencies>
        <!-- if you are deploying a jee application, use scope provided -->
<!-- if you are deploying a jee application, use scope provided -->
        <!-- other dependencies will normally end up as dependencies in the plan and geronimo-plugin.xml -->
        <!-- include dependencies on all deployer modules needed, with scope provided -->

        <dependency>
            <groupId>com.liferay</groupId>
            <artifactId>liferay-portal-lesslibs</artifactId>
            <version>${liferayVersion}</version>
            <type>war</type>
            <scope>provided</scope>
	</dependency>
        <dependency>
            <groupId>org.apache.geronimo.configs</groupId>
            <artifactId>javamail</artifactId>
            <!-- other dependencies will normally end up as dependencies in the plan and geronimo-plugin.xml --><type>car</type>
            <version>${geronimoVersion}</version>
        </dependency>
<!-- includereplaces dependenciesactivemq onjar allin deployer modules needed, with scope provided lib dir -->

        <dependency>
            <groupId>com.liferay<<groupId>org.apache.geronimo.configs</groupId>
            <artifactId>liferay<artifactId>activemq-portal<ra</artifactId>
            <version>${liferayVersion}</version><type>car</type>
            <type>war</type><version>${geronimoVersion}</version>
            <scope>provided</scope>
	</dependency>
        <dependency>
            <groupId>org.apache.geronimo.configs<plugins</groupId>
            <artifactId>javamail<<artifactId>liferay-derby</artifactId>
            <type>car</type>
            <version>${geronimoVersion}<<version>1.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>org.apache.geronimo.plugins<<groupId>portlet-api</groupId>
            <artifactId>liferay-derby</artifactId><artifactId>portlet-api</artifactId>
            <version>1.0</version>
	</dependency>
        <dependency>
            <type>car<<groupId>com.liferay</type>groupId>
            <version>1.0<artifactId>portal-SNAPSHOT<kernel</version>artifactId>
            <version>${liferayVersion}</version>
	</dependency>
        <dependency>
            <groupId>portlet-api<<groupId>com.liferay</groupId>
            <artifactId>portlet<artifactId>portal-api<service</artifactId>
            <version>1.0<<version>${liferayVersion}</version>
	</dependency>

        <dependency>
            <groupId>com.liferay<<groupId>xerces</groupId>
            <artifactId>portal-kernel<<artifactId>xercesImpl</artifactId>
            <version>${liferayVersion}<<version>2.8.1</version>
	</dependency>
 
       <dependency>
            <groupId>com.liferay<<groupId>saxpath</groupId>
            <artifactId>portal-service<<artifactId>saxpath</artifactId>
            <version>${liferayVersion}</version>
	<version>1.0-FCS</version>
        </dependency>

        <dependency>
            <groupId>xerces<<groupId>commons-digester</groupId>
            <artifactId>xercesImpl<<artifactId>commons-digester</artifactId>
            <version>2<version>1.8.1<8</version>
	        </dependency>

        <dependency>
            <groupId>org.apache.geronimo.framework</groupId>
            <artifactId>geronimo-gbean-deployer</artifactId>
            <type>car</type>
            <version>${geronimoVersion}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.geronimo.configs</groupId>
            <artifactId>jetty6-deployer</artifactId>
            <type>car</type>
            <version>${geronimoVersion}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.geronimo.configs</groupId>
            <artifactId>jasper-deployer</artifactId>
            <type>car</type>
            <version>${geronimoVersion}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.geronimo.configs</groupId>
            <artifactId>persistence-jpa10-deployer</artifactId>
            <type>car</type>
            <version>${geronimoVersion}</version>
            <scope>provided</scope>
        </dependency>

    </dependencies>

...

Code Block
            <plugin>
                <groupId>org.apache.geronimo.buildsupport</groupId>
                <artifactId>car-maven-plugin</artifactId>
                <configuration>
                    <deploymentConfigs>
                        <!-- gbean deployer is default.  For jee apps include all deployers your app needs, see properties -->
                        <deploymentConfig>${gbeanDeployer}</deploymentConfig>
                        <deploymentConfig>${j2eeDeployer}</deploymentConfig>
                        <deploymentConfig>${jetty6Deployer}</deploymentConfig>
                        <deploymentConfig>${jasperDeployer}</deploymentConfig>
                        <!--<deploymentConfig>${jpaDeployer}</deploymentConfig>-->
                    </deploymentConfigs>
                    <!-- if you are deploying a jee app specify it here -->

                                        <module>
            <groupId>com.liferay</groupId>
            <artifactId>liferay-portal</artifactId>
            <version>${liferayVersion}</version>
            <type>war</type>
                                        </module>

                    <!-- Normally you can use the maven dependencies unaltered.  If you need to specify import scope
                     you can list the dependencies here as you want them in the plan.xml -->
                    <useMavenDependencies>
                        <value>true</value>
                        <includeVersion>true</includeVersion>
                    </useMavenDependencies>
                    <!-- the instance sets up most of the optional geronimo-plugin.xml content -->
                    <instance>
                        <plugin-artifact>
                            <!-- extract stuff from the car to the specified location (good for config info -->
                            <!--<copy-file relative-to="server" dest-dir="var/roller-data">themes</copy-file>-->
                            <!-- content that should go into var/config/config.xml for module customization -->
                            <!-- note the variable ${RollerContextPathLiferayContextPath} which is further specified in var/config/config-substitutions.properties -->

                                                        <config-xml-content server="default">
                                                            <gbean name="org.apache.geronimo.plugins/liferay-jetty/${liferayPluginVersion}/car">
                                                                <attribute name="contextPath">${LiferayContextPath}</attribute>
                                                            </gbean>
                                                        </config-xml-content>

                            <!-- a user-tweakable variable to go into var/config/config-substitutions.properties -->
                            <config-substitution key="LiferayContextPath">/liferay</config-substitution>
                        </plugin-artifact>
                    </instance>
                </configuration>
            </plugin>

...

Code Block
mvn archetype:create \
  -DarchetypeGroupId=org.apache.geronimo.buildsupport \
  -DarchetypeArtifactId=geronimo-assembly-archetype \
  -DarchetypeVersion=2.2-SNAPSHOT \
  -DgroupId=org.apache.geronimo.plugins \
  -DartifactId=geronimo-jetty-liferay \
  -Dversion=1.0-SNAPSHOT

Edit the geronimo-jetty-liferay pom to set geronimoVersion to 2.1 and include the top level modules you want in your server (console-jetty is optional)

...

Code Block
        <!-- List the plugins you want in your server -->

        <dependency>
            <groupId>org.apache.geronimo.plugins</groupId>
            <artifactId>liferay-jetty</artifactId>
            <version>1.0-SNAPSHOT</version>
            <type>car</type>
        </dependency>

        <dependency>
            <groupId>org.apache.geronimo.plugins</groupId>
            <artifactId>console-jetty</artifactId>
            <version>${geronimoVersion}</version>
            <type>car</type>
        </dependency>

Run the project!

The maven project is now complete. Run it and try out the resulting server!

in liferay-parent run

Code Block

mvn clean </dependency>

install

To try out the resulting server you can find it in your local maven repo under .m2/repository/org/apache/geronimo/plugins/geronimo-jetty-liferay/1.0-SNAPSHOT/geronimo-jetty-liferay-1.0-SNAPSHOT-bin.tar.gz or in the build The packaged servers will be in geronimo-jetty-liferay/target and in your local maven repo. Unpack .

Untar and run :with

Code Block

cd geronimo-jetty-liferay/target
tar xzf geronimo-jetty-liferay-1.0-SNAPSHOT-bin.tar.gz
cd geronimo-jetty-liferay-1.0-SNAPSHOT
./bin/gsh geronimo/start-server

...