Configuring under the settings.xml
The configuration for the metova maven 2.0 mobile plugin is configured in an xml file in your .m2 directory. This file is usually called .m2/metovaMobilePlugin.xml. The name and location of this file is configured in your .m2/settings.xml file as the metovaMobilePluginSettings property:
<settings> <profiles> <profile> ... <properties> <metovaMobilePluginSettings>/Users/username/.m2/metovaMobilePlugin.xml</metovaMobilePluginSettings> </properties> </profile> </profiles> ... </settings>
Sample metovaMobilePlugin.xml
A template of the metovaMobilePlugin.xml can be found here.
There are a few things that can be configured in this file.
- signing/passphrase - This should be the password associated with your RIM cod signing keys.
- mode - This can be one of four different values:
- development - When the plugin is in development mode the build will build the current application to the simulator. This should be your default mode when developing on a project.
- development-all - When the plugin is in development-all mode the build will build for each configured platform and copy to each platform's simulator. This mode is rarely used.
- release - Release will build as it would for development but it will also optimize and sign the application and stage it for release. If you are doing a build to install on a device you will need to use release mode. When the release build is complete it will stage the release in the directory configured in the stagingDir tag.
- release-all - This will do a release as described above for all configured platforms.
- activePlatformId - This refers to a platform version as configured by a <platformVersion id="rim-4.3.0" type="rim"> tag.
- platformVersion - These declare various platforms which the tool can build for. Each one should point to a valid RIM installation. The dir tag indicates the location of the jde. IE: <dir>C:/tools/rim/jde-4.2.1</dir>
- simulators - By default the plugin will deploy to the default JDE simulator directory. If you add a simulators tag to a platformVersion you can configure multiple simulators and an active simulators. The build will only deploy to the active simulator.
Adding support for additional platforms
You can add a new platform such as RIM's OS 4.6 by:
- Install the JDE from RIM's website
- Adding an additional platform version tag to the metovaMobilePlugin.xml file:
<platformVersion id="rim-4.6.0" type="rim"> <dir>C:/tools/rim/jde-4.6.0</dir> <classifiers> <classifier>CLDC-1.1</classifier> <classifier>MIDP-2.0</classifier> <classifier>RIM-4.3.0</classifier> </classifiers> <dependencies> <dependency> <groupId>net.rim</groupId> <artifactId>rim-api</artifactId> <version>4.6.0</version> </dependency> </dependencies> </platformVersion>
- If you get an error about the net.rim.rim-api-4.6.0.jar missing you can add it to your local maven repository by using the mvn:install-file command which is printed in the maven error message. mvn install:install-file -DgroupId=net.rim -DartifactId=rim-api -Dversion=4.6.0 -Dpackaging=jar -Dfile=/path/to/file. In the command, replace the /path/to/file part of the command with the path to the jar comes from the jde's lib/net_rim_api.jar file.

RIM hid some apis in 4.5 so you should avoid trying to build for that OS. 4.3 builds should provide sufficient functionality if pointed to a 4.5 simulator or jde directory.
