Search This Blog

21 April 2010

Galatea - A Maven/Android Archetype

After my experience writing an archetype for Red Dwarf; I decided to do the same thing for Android.  This archetype is based on the maven-android-plugin. I'd like to thank Hugo for helping me get the configuration correct.   So let's get started.

As before...
F:\work>mvn archetype:generate -DarchetypeCatalog=
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO] --- maven-archetype-plugin:2.0-alpha-5-SNAPSHOT:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Interactive mode
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
1: -> ardor3d-archetype (null)
2: -> kryten-archetype (null)
3: -> galatea-archetype (null)
4: -> kryten-archetype (null)
Choose a number: : 3 ((use whatever number is assigned to galatea))
[INFO] snapshot org.eoti.galatea:galatea-archetype:1.0-SNAPSHOT: checking for updates from eoti-public
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = 'c4696ce0aeee29d53523e63f02230636518f8ad2'; remote = 'deb2361707aa66b51d4055be6452e818b9283be2' - RETRYING
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = 'c4696ce0aeee29d53523e63f02230636518f8ad2'; remote = 'deb2361707aa66b51d4055be6452e818b9283be2' - IGNORING
Define value for property 'groupId': :
Define value for property 'artifactId': : TestAndroid
Define value for property 'version':  1.0-SNAPSHOT: :
Define value for property 'package': :
Confirm properties configuration:
artifactId: TestAndroid
version: 1.0-SNAPSHOT
(hit enter)
(hit enter)
 Y: : (hit enter)
[WARNING] Don't override file F:\work\TestAndroid\src\main\android\res\values\strings.xml
[WARNING] Don't override file F:\work\TestAndroid\src\main\android\res\layout\main.xml
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:02.860s
[INFO] Finished at: Sun Apr 18 19:58:56 PDT 2010
[INFO] Final Memory: 6M/11M
[INFO] ------------------------------------------------------------------------

F:\work> cd TestAndroid
The resulting files:

F:\work\TestAndroid>tree /F
Folder PATH listing for volume WINDOWS
Volume serial number is 9827-5E66
│   pom.xml

    │   AndroidManifest.xml
        │   └───res
        │       ├───drawable
        │       │       icon.png
        │       │
        │       ├───layout
        │       │       main.xml
        │       │
        │       └───values
        │               strings.xml

Make sure you have your emulator running (emulator -avd Device1, in my case):
F:\work\TestAndroid>mvn install
This will build, package and deploy it to your emulator.
F:\work\TestAndroid>mvn clean
In addition to cleaning your build tree, that will undeploy your app from the emulator.

Update: The repository has been moved from to  As such, the new command line to launch the archetype is:
F:\work>mvn archetype:generate -DarchetypeCatalog=

No comments:

Post a Comment