| Tip: offline mode Don't forget that you will probably want to run maven most of the time in offline mode with the -o parameter. This will skip any dependency update checks. |
Setup maven to run in eclipse:
- Open External Tool Configurations (Run -> External Tool Configurations)
- Add a new configuration named mvn install. This command will build the currently selected Eclipse project.
- Add a new configuration named mvn eclipse. This goal re-generates the eclipse classpath from the dependencies in the pom.xml file.
- Add a new configuration named mvn install online with libraries. This goal installs the project and downloads any necessary dependencies or plugins. It also builds all the current project's dependencies for the simulator.
- Location ${mvn}
- Working Directory: ${project_loc}
- Arguments: -Dinstall.mobile.dependencies.to.simulator=true clean install
- Add the mvn install, mvn install online with libraries, and mvn eclipse configurations to your favorites under External tools, Organize favorites
- To make your project build in eclipse run mvn eclipse. This will regenerate your class path file. You will also have to change the jdk of the project back to the RIM jre. After this your project should compile in Eclipse.
- Run Mvn Eclipse from your Run menu.
- If this gives you an error follow these instructions: Unbound Classpath Variable M2_REPO
- Refresh your project (right click the project and hit refresh)
- Edit the Build Path (right click -> Build Path -> Configure Build Path
- On the Libraries tab Click JRE System library and click Edit.
- Change the option to Alternate JRE and select a rim jre (such as rim-4.2.1)
- Ensure build is automatically turned on under the Project menu in Eclipse
- Install the RIM API JARs to your local Maven repository. Run the following command for each RIM OS version you plan to build against (e.g., 4.2.1):
- mvn install:install-file -DgroupId=net.rim -DartifactId=rim-api -Dversion=4.2.1 -Dpackaging=jar -Dfile=/path/to/net-rim-api-4.2.1.jar
- Select your project and run mvn install online with libraries. This will output the cod and debug files to the simulator configured in metovaMobilePlugin.xml. If you are in release mode this will also sign and create a release under the staging directory configured in the metovaMobilePlugin.xml

| Tip: Running Maven If you get the error "variable references empty selection ${project_loc}" try clicking on your project in the package explorer so that focus moves to the correct window and then try again. |
