How To deploy a Stardust Portal Project created via Tomcat Archetype

This chapter describes options and required settings for deploying a WAR file or Maven project, which was created via the predefined Stardust Tomcat Portal archetype.

Prior to deployment, create a new Maven project with the Tomcat 7 archetype, as described in chapter Creating a Stardust Runtime Environment with Apache Maven of the Installation Guide. section Maven Archetypes of our Stardust Wiki Maven/Basic Setup page. You can either create the Maven project via commandline and import it in Eclipse later, or create it in Eclipse directly.

Creating the Maven Project via Commandline

To create the Maven project via commandline, enter the following:

mvn archetype:generate -DarchetypeGroupId=com.infinity.bpm.archetypes
    -DarchetypeArtifactId=ipp-archetype-tc7-ipp-portal-war -DarchetypeVersion=<version>
    -DgroupId=com.infinity.test -DartifactId=ipp-portal -Dversion=1.0-SNAPSHOT
mvn archetype:generate -DarchetypeGroupId=org.eclipse.stardust.deploy.jee.archetypes
    -DarchetypeArtifactId=tc7-stardust-portal-war -DarchetypeVersion=<version>
    -DgroupId=org.eclipse.stardust.test -DartifactId=ipp-portal -Dversion=1.0-SNAPSHOT

Importing the Maven Project in Eclipse

To import your project in Eclipse as existing Maven project, perform the following steps:

  1. Select File > Import > Maven > Existing Maven Projects.

    Import as Maven Project

  2. Click Next
  3. Browse to your Maven project and click Finish.

    Browse to Maven Project

For more details please refer to section Importing an existing Maven Project in Eclipse of installation chapter Creating a Stardust Runtime Environment with Apache Maven.

Creating the Maven Project in Eclipse

Prepare an M2 Eclipse environment and create a Maven project in Eclipse as described in section Using the M2Eclipse Plugin to create a new Maven Project of chapter Creating a Stardust Runtime Environment with Apache Maven. M2 Eclipse Plugin on the Stardust Knowledge Base site.

  1. Select File > New > Other and select Maven Project:

  2. Choose project name and location and click Next.
  3. Configure the archetype catalog using one of the options described in the above mentioned section.
  4. Select the ipp-archetype-tc7-ipp-portal-war tc7-stardust-portal-war archetype.
  5. Specify the archetype parameters and click Finish.

Deploying the Project / WAR

You have the following options to deploy the created Portal project or WAR file:

Deploying the Portal WAR on external Tomcat

To deploy the created WAR file on an external Tomcat server, add it to the webapps folder of your Tomcat installation. Note that you have to manually adjust the server.xml file to provide a valid datasource definition as described below.

Using an embedded Derby database

For an embedded Derby database definition, include the following resource definition in the <GlobalNamingResources> section of your Tomcat server.xml file:

<Resource name="AuditTrail.DataSource" description="Embedded Derby database for IPP" 
   factory="org.apache.tomcat.jdbc.naming.GenericNamingResourcesFactory"
   type="org.apache.derby.jdbc.EmbeddedXADataSource"
   databaseName="carnot" user="carnot" password="ag" />

Using a Derby database which is via network

To use a Derby database which is accessible via network, add the following snippet to the <GlobalNamingResources> section of your Tomcat server.xml file:

<Resource name="AuditTrail.DataSource" description="Network Derby database for IPP" 
   factory="org.apache.tomcat.jdbc.naming.GenericNamingResourcesFactory"  
   databaseName="carnot" user="carnot" password="ag" portNumber="1527" 
   serverName="localhost" type="org.apache.derby.jdbc.ClientXADataSource" />

Deploying the Portal Project in RAD

If you deploy the WAR file or Maven project in RAD, a valid datasource definition, which provides access to the embedded Derby database, will be added automatically to your Tomcat server.xml file on audit trail database creation or update.

To deploy the Maven project in Eclipse:

  1. If you do not have defined a Tomcat server yet, add it via File > New > Other > Server > Server.
  2. In the Server view, either create a new Audit Trail database or use an existing database.

    Note
    If you use a database that was created with an earlier release, please remove and re-add the database. Republish the server to automatically add the valid datasource definition in the server.xml.

  3. Import your project in Eclipse as existing Maven project. For details please refer to section Importing an existing Maven Project in Eclipse of installation chapter Creating a Stardust Runtime Environment with Apache Maven.
    1. Select File > Import > Maven > Existing Maven Projects.

      Import as Maven Project

    2. Click Next
    3. Browse to your Maven project and click Finish.

      Browse to Maven Project

  4. You can see your project now in the explorer tree:

    Imported Maven Project

  5. Deploy your project to the server:
    1. Right-click the server in the Server view and select Add and Remove.
    2. Select the project on the left side and click Add.

      Deploy

    3. Select Finish.
  6. Your Portal project is now configured on the server.

    Deploy