I'm pleased to announce the availability of Maven Archetypes for Android.
They are available from Maven Central and the documentation is available
from
https://github.com/akquinet/android-archetypes/wiki
Those archetypes are relying (of course) of the maven-android-plugin
(2.8.0 for now, will be updated to 2.8.1 ASAP).
Two archetypes are available:
* A quick-start archetype creating a ready to deploy Hello World
application.
* An android-with-test archetype creating a multi-module project
containing an Android application and a project running instrumentation
tests of the application
Using those archetypes is quite easy:
For the quickstart:
mvn archetype:generate \
-DarchetypeArtifactId=android-quickstart \
-DarchetypeGroupId=de.akquinet.android.archetypes \
-DarchetypeVersion=1.0.0 \
-DgroupId=your.company \
-DartifactId=my-android-application
And then (you must plug an android device or launch an emulator first):
cd my-android-application
mvn clean install android:deploy
For the android-with-test:
mvn archetype:generate \
-DarchetypeArtifactId=android-with-test \
-DarchetypeGroupId=de.akquinet.android.archetypes \
-DarchetypeVersion=1.0.0 \
-DgroupId=com.foo.bar \
-DartifactId=my-android-project \
-Dpackage=com.foo.bar.android
And then (you must plug an android device or launch an emulator first):
cd my-android-project
mvn clean install
Regards,
Clement Escoffier
Looks good, thanks for the work on this. Usable android-archetypes are
something I'd really like for m2eclipse-android-intergration so that I
can automatically generate a pom.xml for existing Android projects
that do not already have them
Only slight problem is that it defaults to Android 2.2. How do you
generate projects for other Android versions? I imagine you'd have to
have a separate archetype for each version of Android.
Regards...
--
Ricardo Gladwell <ricardo....@gmail.com>
http://www.google.com/profiles/ricardo.gladwell
Twitter: @rgladwell - MSN: axo...@gmail.com
> --
> You received this message because you are subscribed to the Google Groups "Maven Android Developers" group.
> To post to this group, send email to maven-androi...@googlegroups.com.
> To unsubscribe from this group, send email to maven-android-deve...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/maven-android-developers?hl=en.
>
>
On 07.12.10 13:31, "Ricardo Gladwell" <ricardo....@gmail.com> wrote:
>Hi Clement
>
>Looks good, thanks for the work on this. Usable android-archetypes are
>something I'd really like for m2eclipse-android-intergration so that I
>can automatically generate a pom.xml for existing Android projects
>that do not already have them
>
>Only slight problem is that it defaults to Android 2.2. How do you
>generate projects for other Android versions? I imagine you'd have to
>have a separate archetype for each version of Android.
The quickstart targets the 2.2 because it our default platform (at
akquinet). So, yes, we have to provide one per platform. That's pretty
easy to do.
The 'with-test' supports several targets. You can use -Dplatform=... to
set the platform. By default it's 7.
Why one is configurable and one not ?
It's because the main pom generated using archetypes cannot be really
filtered (unfortunately), only the GAV are replaced. For the second
archetype, as it's a multi-module project, the sub-poms can be filtered
correctly.
Regards,
Clement
Just to announce the availability of the 1.0.1 version (in Maven Central)
using the maven-android-plugin 2.8.1 and so supporting Android 2.3.
Regards,
Clement
Cool, let me know if you need any help with this.
I've just deployed a new version of the archetypes (1.0.3) using the
maven-android-plugin 2.8.3.
Another improvement is the ability to configure the targeted Android
platform inside the archetype with -Dplatform= for both archetypes (that
was not possible for the quickstart). By default it uses 7.
Regards,
Clement
On 21.12.10 03:14, "qmx" <q...@qmx.me> wrote:
>I'm getting a strange error trying to generate the project:
>
>Expected root element 'archety
>pe-descriptor' but found 'archetype' (position: START_TAG seen
><archetype>... @1:11)
>
>Both maven 2.2.1 and maven 3.0.1 gives me this
Which command are you using ?
You need to use archetype:generate and not archetype:create because the
archetypes are using the 'new' archetype format (archetype:create is
deprecated and does not support the new format).
Regards,
Clement
than it is weirder than I thought because I **was** running archetype:generate