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.
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.
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.
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
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"
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
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
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.
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
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
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.
bexee is being developed as an Eclipse project which means that you can easily import it into your running Eclipse environment.
MAVEN_REPO
which points to your Maven repository directory.
[screenshot]
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.