How to setup android-maven-plugin ?

329 views
Skip to first unread message

Grab Rab

unread,
Jul 15, 2015, 1:25:12 AM7/15/15
to maven-androi...@googlegroups.com
Hi,

I am looking for a tutorial or a simple example about how to configure this plugin, does it exist any ? I did not manage to find any on the website...

I actually have an Android project which works using maven but I am not comfortable about maven plugin usage (in general). I realy need to use the latest version because my project requires multidex...

Thanks a lot !
Gabriel

Csaba Kozák

unread,
Jul 15, 2015, 6:25:59 PM7/15/15
to maven-androi...@googlegroups.com
You find lots of example projects here.

Manfred Moser

unread,
Jul 17, 2015, 12:55:27 AM7/17/15
to maven-androi...@googlegroups.com
And some documentation about the samples on the website..

http://simpligility.github.io/android-maven-plugin/examples.html

And we do take pull request for improved docs as well ;-)

manfred

Csaba Kozák wrote on 15.07.2015 15:25:

> You find lots of example projects here <https://github.com/simpligility/android-maven-plugin/tree/master/src/test/projects> .
>
> --
> You received this message because you are subscribed to the Google Groups "Maven Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to maven-android-deve...@googlegroups.com <mailto:maven-android-deve...@googlegroups.com> .
> For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout> .

Grab Rab

unread,
Jul 18, 2015, 10:26:38 AM7/18/15
to maven-androi...@googlegroups.com

Hi,

Thank you guys, I did partially manage to configure the plugin. Here is a kind of procedure I think could help some people, I written because I think it could help you to understand where is my mistake ? (see at the end)

STEP 1 : I added the following XML at the end of tag <project> in pom.xml.

<build>
<finalName>${project.artifactId}</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.simpligility.maven.plugins</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>4.3.0</version>
<extensions>true</extensions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.simpligility.maven.plugins</groupId>
<artifactId>android-maven-plugin</artifactId>
<configuration>
<sdk>
<platform>22</platform>
</sdk>
<dex>
<multiDex>true</multiDex>
</dex>
</configuration>
</plugin>
</plugins>
</build>



STEP 2 : Then Eclipse told me "Plugin execution not covered by lifecycle configuration: com.simpligility.maven.plugins:android-maven-plugin:4.3.0:emma (execution: default-emma, phase: process-classes)" so I clicked on "Permanently mark goal emma in pom.xml (...)"


STEP 3 : Eclipse told me "AndroidManifest.xml file missing!" (since maven asked me to move it into src/main/ folder

  1. I removed project from workspace
  2. I updated plugin "Android Maven for Eclipse" from Gladwell to v1.3.2
  3. I reimported the project and now it passes validation

STEP 4 : Perform a Maven clean install "mvn clean install" for ensure all dependencies are installed

FINISH or close to...


But I still need your help, how can I execute project from Eclipse and use remote debug ?? (I can execute from command mvn android:run but it is not helpful)


Thank you in advance :)

Grab Rab

unread,
Jul 18, 2015, 10:38:28 AM7/18/15
to maven-androi...@googlegroups.com
PS : Click on Run As... > Android Application does not work, there is a n error indicatin I have the multidex error (which should be solved because when I execute from cmd it runs normally)

Csaba Kozák

unread,
Jul 18, 2015, 10:51:57 AM7/18/15
to maven-androi...@googlegroups.com
I am afraid ADT does not support multidex.

Csaba Kozák

unread,
Jul 18, 2015, 10:53:43 AM7/18/15
to maven-androi...@googlegroups.com
However, you can start the app from command line. Then in the DDMS perspective in Eclipse, select your device from the list on the left,
then select your process. Then you can click on the bug icon in that Devices panel. That will attach the debugger.

Grab Rab

unread,
Jul 18, 2015, 12:58:17 PM7/18/15
to maven-androi...@googlegroups.com
Seriously ? There is no way to do it simply ??

Holy mother of dragons... I do not want to migrate under Android Studio...

Csaba Kozák

unread,
Jul 18, 2015, 1:05:54 PM7/18/15
to maven-androi...@googlegroups.com
ADT is not developed by Google anymore. The community is continuing Android support in Eclipse under the Andmore project.
Also, the m2e-android plugin may be extended to support multidex.

But currently there is no way i think. Both projects accept contributors. ;)
Reply all
Reply to author
Forward
0 new messages