Developers tutorial. 15 minutes start guide.¶
There are several steps you should do.
Part I. Installing and configuring necessary software.¶
1. You need a working Bazaar client - a distributed version control system.
You can download and find instructions how to install it here:
http://bazaar-vcs.org/Download
After you get a working Bazaar initialize the directory where you will branch the wannatrak project. Here is the instruction:
http://doc.bazaar-vcs.org/bzr.dev/en/user-guide/index.html#branching-a-project.
2. From your local repository execute Bazaar branch command to get wannatrak project:(Optional) Read Bazaar docs to ensure you understand how it works.
http://bazaar-vcs.org/Documentation
bzr branch http://bzr.wannatrak.org/main
3. Configure Maven - a project management tool that builds and deploys Wannatrak application.
Using link below you can find detailed instructions on how to install it: http://maven.apache.org/download.html
To make maven work and to ease its usage create
M2_HOMEandM2environment variables. Also add maven dir toPATH. You can read how to do it at the bottom of the page: http://maven.apache.org/download.html
4. Install DBMS PostgreSQL 8.3. Here are the instructions:
http://www.postgresql.org/download/
5. You need JBoss 4.2.3 Application Server. You can download it from developers site: http://jboss.org/jbossas/downloads/
or right away from SourceForge: http://sourceforge.net/projects/jboss/files/JBoss/JBoss-4.2.3.GA/
To install unzip it, for example to the
c:\JBosses\JBoss-4.2.3.GA
Add new environment variable
WT_JBOSS_HOMEwith the JBoss installation path value. As in the example above it can bec:\JBosses\JBoss-4.2.3.GA
6. (Optional) In order to develop mobile Java application you need to install WTK 2.5.2. All necessary information you can find here:
http://www.j2ee.me/products/sjwtoolkit/download.html
Add new environment variable WTK_HOME with the WTK installation path value.
Part II. Deploying Wannatrak using Maven.¶
If you have installed and configured programs described in part I, you can deploy Wannatrak project with maven.
1. First of all you need to initialize PostgreSQL database, load demonstration data if need and init JBoss (copy libs).
Execute this command from the root of the project to initialize wannatrak:mvn install -P InitDB,LoadDemo,InitJBoss
It has default properties:
<properties>
<db.url>jdbc:postgresql://127.0.0.1</db.url>
<db.driver>org.postgresql.Driver</db.driver>
<db.type>PostgreSQL 8.3</db.type>
<db.username>postgres</db.username>
<db.password>postgres</db.password>
<db.name>wannatrak</db.name>
...
</properties>
If you wish to change any of them, use
-D key as shown below (keep in mind they are case sensitive):mvn install -Ddb.username=myname -Ddb.password=1234
You can combine keys to load demonstration data and change default parameters simultaneously:
mvn install -P InitDB,LoadDemo,InitJBoss -Ddb.username=myname -Ddb.password=1234
The process of demonstration data loading takes some time, be patient.
2. Build the Wannatrak.
Executemvn install command that builds project - middleware and device. If you want to rebuild project:
mvn clean install
There are some profiles for building wannatrak project:
WithClient- web interface based on GWT.
WithClientAndJ2ME- includes client and mobile modules.
Deploy2JBoss- copies middleware, device and client to JBoss
You can combine any of these profiles according to what you need, for example to update mobile client and deploy to JBoss, use this command:
UpdateJ2MEInClient- copies last mobile Jar and Jad files to client/war/download.
mvn clean install -P UpdateJ2MEInClient,Deploy2JBoss
3. It's time to run the project.
Check whether PostgreSQL service started.
Launch JBoss.
Open link below in your browser (be sure firewall doesn't block 8080 port): http://localhost:8080