1 Getting started for developers

1.1 Projekte

If you have just installed and setup your environment, please close your Ide and start it new. Otherwise the new systemenvironmentvariables are not known by your ide.

From the sourcerepository checkout the three Modules StrutsME-Common , StrutsME-Server and StrutsME-Client . The srcpath is located in src/java , the buildpath in target/classes . The access to the sourcerepository is described in http://sourceforge.net/cvs/?group_id=171962 .

If you like it, you can also checkout the three Modules StrutsME-Wishlist-Common , StrutsME-Wishlist-Client and StrutsME-Wishlist-Server of the SampleApplication. Adding all buildfiles in the Antview of Eclipse you will get a picture like this 1.

Abbildung 1: Eclipse - Antview

The dependency of these is

  • StrutsME-Common
  • StrutsME-Server , StrutsME-Client
  • StrutsME-Wishlist-Common
  • StrutsME-Wishlist-Client , StrutsME-Wishlist-Server

In this order, beginning with StrutsME-Common , compile and deploy the modules. This could be done by executing ant deploy in the root of the -Common and -Clientmodules, maven jar:deploy of StrutsME-Server and maven war or maven war:webapp of StrutsME-Wishlist-Server . In the case you use Eclipse, you could generate your projectsettings via maven eclipse or maven eclipse:generate-project and maven eclipse:generate-classpath in the rootdirectory of each module. There exists similiar targets for other Ides like Intelliji Idea.

1.2 Configuration

The build.properties are used to configure the projectproperties for the Client- and Commonmodules. The following properties are required.

Id of the Module, e.g. StrutsME-Wishlist-Client.
[1.0, 1.1] used cldc-Version
[1.0, 2.0] used midp-Version
actual version of the project. e.g. SNAPSHOT
[ true , false] - during the buildprocess a preverify is performed
[true, false ] the deployed jar would not be obfuscated. This should only set to true for a executable midlet, not for a module which is integrated in other modules.

The name of the generated jar-file follows the pattern ${midlet.id}-${project.version}.jar.

1.3 Build Projects

Project Ant Maven
StrutsME-Common deploy
StrutsME-Client deploy
StrutsME-Server jar:install
StrutsME-Wishlist-Common deploy
StrutsME-Wishlist-Server war
StrutsME-Wishlist-Client build

Tabelle 1: projects

1.4 Running and debugging the client

If you want to debug the client, first you have to configure a RemoteDebugSession in your Ide. In the case of Eclipse this could be done by selecting Run/Debug, select Java Remote Application and add a new launchconfiguration. Set the title of the new launchconfiguration and change the port to 7654. This is the defaultDebugport. Changing of this port is made by updating the debug target in the build.xml. See also figure 2.

Abbildung 2: Eclipse - Remote Debugconfiguration

After the deployment of the serverapplication to and starting the webserver, the client could be started in the emulator of the WTK by executing the ant run or ant debug command. In the case you have started the emulator via the ant debug command, you have to establish the RemoteDebugSession from your Ide, when the emulator appears.

see also 2

2 Daily work

2.1 Common Buildprocess

2.2 Ant targets

This section describes the public targets defined in the buildfiles build.xml for ant. Referenced targets in the description, for example [build] in the [jar]-target, are targets the currently target depends on.

Common targets

updates all referenced jars and compiles the project.
[build] generates a jarfile.


[jar] copy the jarfile to the directory defined by MOBILE_REPOSITORY/strutsme/jars .
[jar] the emulator is started with the midlet defined by the module.jad file
[jar] the emulator is started in debugmode with the midlet defined by the module.jad file. You can then debug the midlet by starting a remote debug session. The settings for this session are
  • hostname = localhost
  • StandardsocketAttach
  • the default connectionport is 7654 . The connectionport could be changed by editing the debug.port property of the debugtarget.


[deployable] obfuscates the jarfile
run deployable
[jar] the obfuscated jarfile would be started in the emulator.


To build the server you have to perform the following steps.

  1. -common: ant deploy deploys the commonmodule of your application. This is needed only, if you have modified the common-module.
  2. -server: your warbuild-command.