Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using maven android archetype with eclipse

I am trying to use the following archetype. https://github.com/akquinet/android-archetypes/wiki/Android-release-archetype

I can follow the instructions on the page fine (using the terminal)
I was wondering, how do I do this in Eclipse? Is there a sort of command line interface I can input the required commands? i.e

   mvn archetype:generate \
  -DarchetypeArtifactId=android-release \
  -DarchetypeGroupId=de.akquinet.android.archetypes \
  -DarchetypeVersion=1.0.5 \
  -DgroupId=com.foo.bar \
  -DartifactId=my-android-project \
  -Dpackage=com.foo.bar.android

Thanks

like image 411
dewijones92 Avatar asked Jul 18 '11 15:07

dewijones92


People also ask

Can I use Maven in Eclipse?

You can Launch Maven builds from within Eclipse. It does the dependency management for Eclipse build path based on Maven's pom. xml.


2 Answers

  1. Install m2eclipse plugin
  2. create new maven project
  3. next button takes you to archetype selection
  4. optionally configure archetype catalogues, shouldn't be necessary for this archetype (android-release), as the latest version 1.0.5 is in the central maven repo.
  5. next, next, next ...

Update:

To get it working I did the following:

  1. download http://repo1.maven.org/maven2/archetype-catalog.xml save it as user-home/.m2/central-archetype-catalog.xml
  2. in eclipse create new maven project
  3. next button
  4. configure catalogs, add new local catalog point to file created in step 1.
  5. after closing the catalog configuration dialog, make sure that the drop-down catalog selector is on all catalogs or on the new local catalog that you just defined
  6. in the filter type 'android-release'
  7. select the android-release archetype and click next
  8. enter your selected group-id and artifact-id

I did notice a problem reported that the project directory could not be renamed.
The project had been created on disk, so I imported it into eclipse using
Import > Maven > Existing maven projects

like image 168
crowne Avatar answered Sep 20 '22 12:09

crowne


If you are starting with a new project you can use the Maven Android archetypes to create Android projects completely within Eclipse you just need to do the following:

  1. Create a new Maven Project (File -> New -> Project... then select Maven -> Maven Project).
  2. When prompted to Select Archetype click Add Archetype...
  3. In the dialog that appears enter "de.akquinet.android.archetypes" for Archetype Group Id.
  4. In Archetype Artifact Id enter "android-quickstart".
  5. In Archetype Version enter "1.0.6" and continue.
  6. When prompted enter your desired project group and artifact ID, version and, optionally, set the "platform" property for the Android version (defaults to '7').
  7. Set the "android-plugin-version" property for the Android version to '3.0.0'.
  8. Click Finish
  9. Right-click on new project and select Maven -> Update Project Configuration.
like image 23
Ricardo Gladwell Avatar answered Sep 21 '22 12:09

Ricardo Gladwell