Configuration

This document describes how to set up a sample development environment for bexee. In fact it describes how to reproduce the development environment that we used during development. It is meant to simplify the setup process and get you up and running as fast as possible and without going through the hassle of experimenting with different configurations that might not work. You are certainly not forced to use the mentioned tools, e.g. you are free to use a SSH client of your personal choice, but we can not guarantee that everything will work properly, so we recommend that you follow the instructions in this document.

Info!It is assumed that you have checked out the sources from CVS and are more or less familiar with the tools referred to in this document.

Info!The examples used in this document are Windows specific. You should be able to set up a similar environment on a Unix-based machine, if you adapt the examples appropriately for your system.

Maven

Installation

Download and install Maven 1.0 from the Apache Maven Project Site.

After installing Maven make sure that the MAVEN_HOME environment variable is set and points to the location where you installed maven:

MAVEN_HOME=c:\java\maven

Info!If you install Maven on a Windows machine, make sure that you set MAVEN_HOME as a system variable (not user variable).

Add %MAVEN_HOME%\bin to your path so you can execute it from any location within a shell:

Path=...;%MAVEN_HOME%\bin

Next, create your local repository by running the following commands:

%MAVEN_HOME%\bin\install_repo.bat %USERPROFILE%\.maven\repository
mkdir "%USERPROFILE%\.maven\repository\ejb\jars"
copy ejb-2_1-api.jar "%USERPROFILE%\.maven\repository\ejb\jars\ejb-2.1.jar"

Configure project.xml

Everything in Maven gravitates around the definition of a project. The unit of work in Maven is the project, so before you can get started with Maven you need to adapt the project definition to your environment.

This particularly means that you might need to make slight adjustments to the project.xml like i.e. changing the information on how to access your CVS and web server

Copy User Specific build.properties

Change to the bexee directory (that is where you checked out the sources from CVS). Copy the build.properties to your user home directory. Don't worry about modifying it right now. We will explain how to set the values in section SSH Access to Web Site.

Below you see a sample file:

maven.username=patforna
maven.ssh.executable=plink
maven.scp.executable=pscp
maven.ssh.args=-A -ssh -2 -i ${user.home}/sf-shell.ppk
maven.scp.args=-2 -i ${user.home}/sf-shell.ppk

SSH Access to Web Site

In order to be able to deploy the web site via SSH to the web server, you'll have to obtain an SSH client. We used PuTTY in our environment, since it comes with the functionality we need and is very light.

In fact, all you need is three programs called PSCP, Plink and PuTTYgen. Copy the binaries into a directory that is on your path (i.e. into your windows\system32 directory). This way you can execute the programs from anywhere without specifying their absolute location.

  1. Execute PUTTYGEN.EXE
  2. Select the desired key type ("SSH2 DSA", within the "Parameters" section). [screenshot]
  3. Click on the "Generate" button.
  4. Follow the on-screen instructions ("Please generate some randomness by moving the mouse over the blank area"). Key generation will be performed immediately afterward.
  5. Enter username@shell.sf.net in the "Key comment" field, replacing 'username' with your SourceForge.net user name. This comment will help you to identify the purpose of this key. For the sake of simplicity leave the "Key passphrase" fields empty. Like this you don't need other tools to be run in the background (like i.e. Pageant) which makes automatic deployment with Maven a lot easier, but you have to be aware that your private key will be saved as plain text. [screenshot]
  6. Click on the "Save private key" button; use the resulting dialog to save your private key data for future use. You may use a filename such as "sourceforge.ppk" for example. The .ppk extension is used for PuTTY Private Key files. Save the private key in your user home directory. [screenshot]
  7. Go to your Account Maintenance page on the SourceForge.net site and click on [Edit SSH Keys for Shell/CVS]. Copy your public key data from the "Public key for pasting into OpenSSH authorized_keys file" section of the PuTTY Key Generator and paste in to the provided form on the SourceForge.net site. [screenshot]
  8. Exit the PuTTY Key Generator.
  9. Use plink for example to manually connect to your web server (the one you defined in project.xml) from a shell. It's important that you do it manually the first time, as PuTTY will ask you to store the host fingerprint (answer yes).

For more information about Using public key authentication with putty, please refer to PuTTY manual: Using public keys for SSH authentication

Tomcat Deployment

To be able to deploy war files to Tomcat you first need to download the Codeczar Tomcat plugin. You can do this from within maven by entering the following command:

maven -DartifactId=maven-tomcat-plugin -DgroupId=codeczar-tomcat -Dversion=1.1 plugin:download

Give it a Spin...

Now, let's try if everything is set up correctly. Enter

maven site:deploy

Maven will first download all the required jars. This may take a couple of minutes because you most likely have not downloaded any of the required jars before.

Eclipse

bexee is being developed as an Eclipse project which means that you can easily import it into your running Eclipse environment.

  1. Foremost you have to define a new classpath variable called MAVEN_REPO which points to your Maven repository directory. [screenshot]
  2. Then and select File -> Import. Choose 'Checkout Projects from CVS'. [screenshot]
  3. Enter information on how to access CVS. [screenshot]
  4. Select 'Use an existing module' and browse for the bexee module. [screenshot]
  5. Select 'Check out as project in workspace' and use bexee as project name. [screenshot]
  6. Finally enter the path where you want to check out the project and click finish. [screenshot]

Info!Eclipse will now probably complain that not all folders on the build path are present. You can solve this problem by running maven site in a shell, which will create the necessary folders. After refreshing the project in Eclipse everything should be ok.