I really want to follow up on my Groovy Maven Blackberry work and so far this is all I can do. Yesterday I managed to actually run it for the first time in over a year or two since I wrote it. My earlier blog post was completely inaccurate, indicating that all you needed is the plugin source. It has a HEAVY dependency on RAPC, and I am not authorized to distribute RAPC. (I am also not authorized to distribute breakfast cereal to to my children because I’m not as calorie conscious and portion aware as I should be… says the wife.) In order to actually use my plugin you have to create one of various “rapc-compile-tools” bundles and list it as a dependency of the plugin. It’s very important the you be version aware when building and listing the “rapc-compile-tools”. Let me elaborate.
My plugin looks in its CLASSPATH under a folder “/Blackberry-utils/” for the following files:
“rapc.jar”, “net_rim_api.jar”, “SignatureTool.jar”, “sigtool.csk”, “sigtool.db”, “sigtool.set”
In order for the magic to work you must create a Maven jar artifact which includes a “/Blackberry-utils/” folder holding these files. The plugin expands the files from the dependency into the system’s temp folder and then uses all of these files to actually perform the compile to cod format. It does a bunch of other (probably unnecessary) hickery-doodle to create a jar identical to what will be in the final cod.
What you need to do is download a version of the JDE. Then create a “Blackberry-utils” folder somewhere on your hard drive. Copy each of the above listed files into this folder then jar the folder. You can find most of them in your JDE download which can be expanded by running the installer. (See my earlier post about running the Simulator on Mac for details on running Windows installers on Mac.) The sigtool files are created after you build and receive a RIM certificate. (If you don’t have a RIM certificate you can fake these files by renaming empty text files but they must be present for the plugin to work.) Finally deploy the jar to your Artifactory (or other) Maven repository. If you don’t use a local hosted Maven repository then you can manuallly create a pom file place a copy in the jar (I forget exactly where it goes but I think it belongs under /META-INF) and place both the pom file and the jar in a Maven conventionally formed path under “$HOME/.m2/repo”. The final path will probably look like “$HOME/.m2/repo/your/group/artifactid/version”. It’s to your benefit to install Artifactory or something equivalent to simplify both this deployment and future license restricted dependencies like javax.mail and commercial APIs.
Its a rather involved process to create the rapc-compile-tools and I hope to simplify in the future. Also be version aware and you may want to create multiple versions of the rapc-compile-tools to support various Blackberry devices and OS versions. For instance, you may want to build version 4.3.0 for older Blackberry curve devices and 4.5.0 and 4.7 for the newer Storm, Bold, and Tour devices. What you DO NOT want to do is compile against 4.7 and deploy to a Storm running an older 4.5 OS. remember your target audience on blackberry is far less likely to update their firmware than an iPhone user. You’re also likely to run into users sporting the 4.2.1 and older OSes so use the lowest possible version of the RIM apis possible to build your application.

[...] this is optional below because it had been over a year since I used the tool myself. I am writing a followup post to elaborate on the [...]
By: Groovy Mobile Development On Maven For Mac « Can’t see nothing but the source code on March 16, 2010
at 8:09 pm
Could you please share your maven-blackbarry-plugin ?
thanks.
By: adam on October 12, 2010
at 1:34 pm
My tools are in the Groovy repo untouched in the past year or so.
https://svn.codehaus.org/groovy/trunk/groovy/modules/maven-plugins/
I’d like to steal a moment to get back into developing them but I’m so busy on other things.
By: Cliff on October 13, 2010
at 3:23 pm