Errai: The browser as a platform

Wednesday, March 20, 2013

Maven Cordova Plugin

As you may already know, we are also focusing on making mobile applications with Errai. We have something that will make your life really easy. Inspired by the Cordova CLI, we have created something similar that is Maven based.

How does it work

You want to create a Cordova based Errai project, then all you have to do is add this plugin to your maven build. The plugin will create a config.xml in your project folder. In this configuration file you can set settings, like icon and application name. After that, performing a build will copy the generated web files into the Cordova platforms and these will get built.
Now you have integrated mobile platform builds into your regular release cycle. You can run the simulator with the generated binaries all out of your maven project.

Installation

Create an Errai project with one of the archetypes and add the following to your pom Now when you perform a maven install your Android and iOS projects also get built. To see the result of that in the simulator, you just use a simple maven command:
mvn cordova:emulator -Dplatform=android
This will start the Android emulator for your project.
It's still work in progress, but if you want to become an early adopter, just put this repo in your pom and you are ready to go Let me know what you think of it and what kind of features you would like to see in there.

1 comment:

  1. Hi,
    I would like to try it today but after following these steps I get this error message:
    [INFO]
    [INFO] --- cordova-maven-plugin:1.0-SNAPSHOT:emulator (default-cli) @ bbuster ---
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 1.611s
    [INFO] Finished at: Wed May 01 11:49:43 CEST 2013
    [INFO] Final Memory: 8M/112M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.jboss.errai:cordova-maven-plugin:1.0-SNAPSHOT:emulator (default-cli) on project bbuster: Execution default-cli of goal org.jboss.errai:cordova-maven-plugin:1.0-SNAPSHOT:emulator failed: The directory /home/boo/projects/errai/bbuster/target/template/platforms/android/cordova does not exist -> [Help 1]
    [ERROR]

    ReplyDelete