Skip to content

IanDarwin/mvn-archetype-android

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mvn-archetype-android

This Archetype creates an Android project that can be built with Maven, Eclipse, Gradle, or Android Studio.

Why?

Why another Maven Android archetype? There may be better ones out there…​ I just wanted one I could keep up-to-date and that I could tailor to make projects that work on all of Eclipse, Maven, Gradle and Android Studio.

Usage

First, until I get this onto Maven Central, just grab the source project and do mvn install.

Just run mvn archetype:generate as usual. Here’s an example.

mvn archetype:generate \
	-DarchetypeGroupId=com.darwinsys \
	-DarchetypeArtifactId=mvn-archetype-android \
	-DarchetypeVersion=1.0.0-SNAPSHOT \
	-DgroupId=com.example123 \
	-DartifactId=android123 \
	-Dversion=1.0.0-SNAPSHOT \
	-DinteractiveMode=false

This can be run using scripts/basic.sh under *Nix, but you’ll want to change the groupId and artifactId before running.

The file scripts/androidproject uses the shell builtin getopts to parse arguments and can be run as follows:

scripts/androidproject [-g groupId][-p packageName][-d parentDirectory] artfactName

e.g.,

scripts/androidproject -d /tmp -g com.example demoproject54

PreReqs for Generated Project

For Maven or Eclipse, you must have extracted the Android SDK into Maven format using the maven-android-installer.

For Eclipse, as above, plus, you must have AndMore and M2E in your install (get it from Help→Eclipse Market Client).

For Gradle or Android Studio, it may "just work", though it will demand to upgrade the project if you’ve been using your Studio installation for more than 2.5 hours.

Arguments

When running mvn archetype:generate you can optionally change the package name with e.g., -Dpackage=com.example. The default package name is derived from the groupId parameter.

About

Maven Archetype for Maven-Eclipse-Gradle-Studio-buildable Android

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published