maven android plugin + Android library

128 views
Skip to first unread message

Macarse

unread,
Nov 2, 2010, 12:54:09 PM11/2/10
to Maven Android Developers
Hi,

In London's Droidcon I went to Hugo's maven+hudson presentation.
Pretty cool.
Afterwards I went to Mark Murphy's talk about reusable components
using Android libraries.

Is it possible to add an Android library as a dependency?

Thanks.

Amir Raminfar

unread,
Nov 2, 2010, 3:35:41 PM11/2/10
to maven-androi...@googlegroups.com
Do you mean maven dependency? Or something else?


--
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.


Macarse

unread,
Nov 2, 2010, 3:39:23 PM11/2/10
to maven-androi...@googlegroups.com
My app might depend on a android library and I would also like to be
able to build android libraries with maven.

Manfred Moser

unread,
Nov 2, 2010, 3:43:48 PM11/2/10
to maven-androi...@googlegroups.com
The plugin supports the notion of apksources. This is documented in the wiki.

It can not work with Android library projects yet, but there is an issue
for it and we would love a contribution that add support.

You can use pure Java dependencies very easily.

manfred

Amir Raminfar

unread,
Nov 2, 2010, 3:58:18 PM11/2/10
to maven-androi...@googlegroups.com
You can put this in your pom:

 <!-- Android -->
        <dependency>
            <groupId>com.google.android</groupId>
            <artifactId>android</artifactId>
            <version>2.2.1</version>
            <scope>provided</scope>
        </dependency>

Macarse

unread,
Nov 2, 2010, 4:05:19 PM11/2/10
to maven-androi...@googlegroups.com
Amir:

I am talking about this kind of android libraries:
http://developer.android.com/guide/publishing/licensing.html

Amir Raminfar

unread,
Nov 2, 2010, 4:08:04 PM11/2/10
to maven-androi...@googlegroups.com
Ah sorry, I have never used those. I would search in maven repo first. If its a jar file then you can include it in maven :)

Manfred Moser

unread,
Nov 2, 2010, 4:11:28 PM11/2/10
to maven-androi...@googlegroups.com
You should be able to set up the LVL code as a apksources projects or just
inside your application. It is just a bunch of classes from what I can
tell.

manfred

Hugo Josefson (Jayway)

unread,
Nov 3, 2010, 4:02:12 PM11/3/10
to Maven Android Developers
Hi!

Thanks for attending my talk. It was great to see so many interested
people in the same room :)

I was also at Mark Murphy's talk where he encouraged the Android
community at large to create libraries for common code, *and share
it*. That was good, and I wholeheartedly agree.

As Manfred mentioned, this type of library project is not directly (at
least not consciously) supported by maven-android-plugin, simply
because it didn't exist when we implemented the apksources packaging
type:
http://code.google.com/p/maven-android-plugin/wiki/ApkSourcesDependency

Issue 96 tracks any progress on library support:
http://code.google.com/p/maven-android-plugin/issues/detail?id=96

Thanks,
Hugo

Macarse

unread,
Nov 3, 2010, 4:21:01 PM11/3/10
to maven-androi...@googlegroups.com
Cool.
Star added :)

Thanks.

Sergio

unread,
Nov 4, 2010, 6:03:36 AM11/4/10
to Maven Android Developers
Hello, my name is Sergio, I've read your comments in this post and in
the Filtering AndroidManifest post, I've discovered this forum because
I've spent one week trying to configure Eclipse with Maven-Android-
Plugin, and there is not way to do this. Before to do anything If this
is not the discussion to put this post, please, move it away to the
correct place, I just want someone to answer my questions and I post
here because I found activity.

After "wasting" my time trying to configure Maven with eclipse to use
the IU plugin (M2Eclipde) I found it impossible, I can open the Maven
structure with eclipse, select the gen folders as source folders and
start to work with each project separately, running the project as
android projects individually, but I can’t try to execute maven orders
like install or clean because from Eclipse if I do this, the Maven
project structure modify the android structure under Eclipse IDE and
the project become unstable having conflict with classes and bin
files. So, in my opinion the best thing I can do is charging maven
structure in Eclipse, and work separately as individual android
projects but on the other hand execute Maven orders under command
line, appart from eclipse UI.

Is not a beautiful solution but is the only I've found do at the
moment, I expect to receive a master lesson about how to fix this
problem, is it possible to declare the gen folder at any pom.xml to be
included automatically?, is there some different plugin that allows
integrate maven into Eclipse in an easier way?, do you recomend me to
use IntelliJ to develop maven-android plugins?

Thank you

Ricardo Gladwell

unread,
Nov 4, 2010, 7:31:40 AM11/4/10
to maven-androi...@googlegroups.com
Hi Sergio

I'm currently working on an Eclipse problem that may resolve some of
the issues that you're working on and simplify the development with
maven-android-plugin in Eclipse:

https://code.google.com/a/eclipselabs.org/p/m2eclipse-android-integration/

Unfortunately, the code is not in a state for regular use, but I'm
hoping to issue a new release in the next few weeks that should work.
Please stay subscribed to this mailing list for updates.

Regards...

--
Ricardo Gladwell <ricardo....@gmail.com>
http://www.google.com/profiles/ricardo.gladwell
Twitter: @axonrg - MSN: axo...@gmail.com

Sergio Martínez

unread,
Nov 4, 2010, 10:29:07 AM11/4/10
to maven-androi...@googlegroups.com
Ok, thank's Ricardo, I expect your solution to be fixing all problem as possible, because right now is something crazy try to work with Android-maven-Plugin from Eclipse UI.

Let me now as soon as the new release be ready to test.

Thank's

Amir Raminfar

unread,
Nov 4, 2010, 10:50:16 AM11/4/10
to maven-androi...@googlegroups.com
Sergio,

Give Intellij EAP a try. I have been using it for two weeks now and I think it works well. The only problems I have are the things I noted earlier in this thread. But its not a stopper. You can still compile and deploy using intellij. Intellij will still look for logcat and print out android logs. I have been in contact with the folks at jetbrain, and there is a plan to add a setting to point to the apk file. This should allow deployment and debugging options.
http://confluence.jetbrains.net/display/IDEADEV/IDEA+X+EAP
Amir
Thank's

> android projects individually, but I can�t try to execute maven orders

Manfred Moser

unread,
Nov 4, 2010, 12:58:35 PM11/4/10
to maven-androi...@googlegroups.com
According to the jetbrains developer working on this, it is already
implemented. To use it you have to compile the community edition from
source though. Or wait for the next eap version that should come out any
day now..

>> <mailto:ricardo....@gmail.com>>
>> http://www.google.com/profiles/ricardo.gladwell
>> Twitter: @axonrg - MSN: axo...@gmail.com <mailto:axo...@gmail.com>


>>
>> On 4 November 2010 10:03, Sergio <ser.mar...@gmail.com

>> <mailto:ser.mar...@gmail.com>> wrote:
>> > Hello, my name is Sergio, I've read your comments in this post
>> and in
>> > the Filtering AndroidManifest post, I've discovered this forum
>> because
>> > I've spent one week trying to configure Eclipse with
>> Maven-Android-
>> > Plugin, and there is not way to do this. Before to do anything
>> If this
>> > is not the discussion to put this post, please, move it away to
>> the
>> > correct place, I just want someone to answer my questions and I
>> post
>> > here because I found activity.
>> >
>> > After "wasting" my time trying to configure Maven with eclipse
>> to use
>> > the IU plugin (M2Eclipde) I found it impossible, I can open the
>> Maven
>> > structure with eclipse, select the gen folders as source folders
>> and
>> > start to work with each project separately, running the project as

>> > android projects individually, but I can�t try to execute maven


>> orders
>> > like install or clean because from Eclipse if I do this, the Maven
>> > project structure modify the android structure under Eclipse IDE
>> and
>> > the project become unstable having conflict with classes and bin
>> > files. So, in my opinion the best thing I can do is charging maven
>> > structure in Eclipse, and work separately as individual android
>> > projects but on the other hand execute Maven orders under command
>> > line, appart from eclipse UI.
>> >
>> > Is not a beautiful solution but is the only I've found do at the
>> > moment, I expect to receive a master lesson about how to fix this
>> > problem, is it possible to declare the gen folder at any pom.xml
>> to be
>> > included automatically?, is there some different plugin that
>> allows
>> > integrate maven into Eclipse in an easier way?, do you recomend
>> me to
>> > use IntelliJ to develop maven-android plugins?
>> >
>> > Thank you
>> >
>> > --
>> > 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

>> <mailto:maven-androi...@googlegroups.com>.


>> > To unsubscribe from this group, send email to
>> maven-android-deve...@googlegroups.com

>> <mailto:maven-android-developers%2Bunsu...@googlegroups.com>.


>> > For more options, visit this group at
>> http://groups.google.com/group/maven-android-developers?hl=en.
>> >
>> >
>>
>> --
>> 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

>> <mailto:maven-androi...@googlegroups.com>.


>> To unsubscribe from this group, send email to
>> maven-android-deve...@googlegroups.com

>> <mailto:maven-android-developers%2Bunsu...@googlegroups.com>.

Amir Raminfar

unread,
Nov 4, 2010, 3:43:20 PM11/4/10
to maven-androi...@googlegroups.com
I think I'll wait :)

>>> > android projects individually, but I can�t try to execute maven

Manfred Moser

unread,
Nov 4, 2010, 3:44:47 PM11/4/10
to maven-androi...@googlegroups.com
I think there are a LOT of users waiting for this Ricardo! It would be
awesome if you could get it done.

Ricardo Gladwell

unread,
Nov 5, 2010, 4:11:07 AM11/5/10
to maven-androi...@googlegroups.com
Will do my best, but hampered by poor documentation of the m2eclipse
API, inexperience doing desktop development, and general lack of free
time. Hopefully will get something done this weekend.

Sergio

unread,
Nov 16, 2010, 5:07:41 AM11/16/10
to Maven Android Developers
I post again because I'm trying again configure Eclipse with Maven
Android Plugin (although maybe I'll be using Intellij on the future),
but right now it's become in a personal challenge getting a
configuration that allows to work in a comfortable way.

To begin with, you have to open the maven project as android project
or if you don't do that you have to add the \gen folder to source
folder because this is the default eclipse folder for generated-
sources. Isn't it? is there anyway for changing this?.

Anyway once, you have generated-resources identifies for Eclipse, you
have two deploying ways:

1- The first one is run as android aplication and it's executed
normally in the emulator

2- The second one is making clean and install from eclipse but when yo
make clean, eclipse inform you that there is something wrong with the
classfiles and the conversion to Android executable, exactly those are
the two errors who appear:

- no classfiles specified.
- Conversion to Dalvik format failed with error 1.

Anyway the clean proccess it finished without problems and you can
also make maven install from eclipe and it finish successfully. But it
seems like if Android Eclipse project structure had been modified and
there is something missed right now, as consecuence you can't run as
Android application your project anymore. You have to fix those
problems making an Eclipse project Clean.

Of course I can make "$ mvn clean install" at comand line and Eclipse
doesn't note anything, I mean the project structure is not modified
and I don't get any error. But it would be nice having the project to
be able to execute as maven project in Eclipse.

Is there anyway to avoid to be all the time making clean at your
project and also avoid those kind of errors, have you already spoken
about this matter before?, Where?

Ricardo, is the new version of Maven2Eclipse solving those problem?
what's about it? have courage with your work.

Thank's people...

Sergio Martínez

On Nov 5, 9:11 am, Ricardo Gladwell <ricardo.gladw...@gmail.com>
wrote:
> Will do my best, but hampered by poor documentation of the m2eclipse
> API, inexperience doing desktop development, and general lack of free
> time. Hopefully will get something done this weekend.
>
> --
> Ricardo Gladwell <ricardo.gladw...@gmail.com>http://www.google.com/profiles/ricardo.gladwell
> Twitter: @axonrg - MSN: axo...@gmail.com
>
> On 4 November 2010 19:44, Manfred Moser <manf...@mosabuam.com> wrote:
>
>
>
> > I think there are a LOT of users waiting for this Ricardo! It would be
> > awesome if you could get it done.
>
> >> Hi Sergio
>
> >> I'm currently working on an Eclipse problem that may resolve some of
> >> the issues that you're working on and simplify the development with
> >> maven-android-plugin in Eclipse:
>
> >>https://code.google.com/a/eclipselabs.org/p/m2eclipse-android-integra...
>
> >> Unfortunately, the code is not in a state for regular use, but I'm
> >> hoping to issue a new release in the next few weeks that should work.
> >> Please stay subscribed to this mailing list for updates.
>
> >> Regards...
>
> >> --
> >> Ricardo Gladwell <ricardo.gladw...@gmail.com>

Ricardo Gladwell

unread,
Nov 21, 2010, 7:36:37 AM11/21/10
to maven-androi...@googlegroups.com
Hi Sergio

Are you using the m2eclipse-android-integration plugin? Or just the ADT
with m2eclipse plugin?

On Tue, 2010-11-16 at 02:07 -0800, Sergio wrote:
> Ricardo, is the new version of Maven2Eclipse solving those problem?
> what's about it? have courage with your work.

Thanks, I'm making slow progress, but I'm getting there. I'm in
communication with an m2eclipse developer who is being really helpful so
hopefully we'll get the issues ironed out soon and a new version of
m2eclipse-android-integration released.

Regards...

--
Ricardo Gladwell <ricardo....@gmail.com>

Sergio Martínez

unread,
Nov 23, 2010, 4:51:42 AM11/23/10
to maven-androi...@googlegroups.com
Hi Ricardo, 

I'm using both, and I suppose the problem is that the relationship between ADT and m2eclipse-android-integration plugin is not a love relationship exactly. it is?


--

Ricardo Gladwell

unread,
Nov 23, 2010, 5:54:02 AM11/23/10
to maven-androi...@googlegroups.com
Hi Sergio

Sorry, I'm confused: are you just using ADT + m2eclipse or ADT +
m2eclipse + m2eclipse-android-integration?

The problem is more that m2eclipse is undergoing a lot of changes at
the moment, including becoming part of the Eclipse project itself, so
the extension API is poorly documented and a moving target.

I had a break through last night so things are getting steadily better
so please bear with me.

Regards...

Twitter: @rgladwell - MSN: axo...@gmail.com

2010/11/23 Sergio Martínez <ser.mar...@gmail.com>:

Message has been deleted

Sergio

unread,
Nov 24, 2010, 3:16:57 AM11/24/10
to Maven Android Developers
I'm using:

* Eclipse Galileo version 3.5+
* Android Developer Tools plug-in version 0.9.5+
* M2Eclipse plug-in version 0.10.0+
* Maven Android Plugin version 2.3.3+

Tha'ts the resources we can find at :
http://code.google.com/a/eclipselabs.org/p/m2eclipse-android-integration/

So, I think I'm not using the last one you said: m2eclipse-android-
integration.

Thank's you are working hardly and I think you are finishing soon.

Thank's again.

On Nov 23, 11:54 am, Ricardo Gladwell <ricardo.gladw...@gmail.com>
wrote:
> Hi Sergio
>
> Sorry, I'm confused: are you just using ADT + m2eclipse or ADT +
> m2eclipse + m2eclipse-android-integration?
>
> The problem is more that m2eclipse is undergoing a lot of changes at
> the moment, including becoming part of the Eclipse project itself, so
> the extension API is poorly documented and a moving target.
>
> I had a break through last night so things are getting steadily better
> so please bear with me.
>
> Regards...
>
> --
> Ricardo Gladwell <ricardo.gladw...@gmail.com>http://www.google.com/profiles/ricardo.gladwell
> Twitter: @rgladwell - MSN: axo...@gmail.com
>
> 2010/11/23 Sergio Martínez <ser.mar.rod....@gmail.com>:
>
> > Hi Ricardo,
> > I'm using both, and I suppose the problem is that the relationship between
> > ADT and m2eclipse-android-integration plugin is not a love relationship
> > exactly. it is?
>
> > On Sun, Nov 21, 2010 at 1:36 PM, Ricardo Gladwell
> > <ricardo.gladw...@gmail.com> wrote:
>
> >> Hi Sergio
>
> >> Are you using the m2eclipse-android-integration plugin? Or just the ADT
> >> with m2eclipse plugin?
>
> >> On Tue, 2010-11-16 at 02:07 -0800, Sergio wrote:
> >> > Ricardo, is the new version of Maven2Eclipse solving those problem?
> >> > what's about it? have courage with your work.
>
> >> Thanks, I'm making slow progress, but I'm getting there. I'm in
> >> communication with an m2eclipse developer who is being really helpful so
> >> hopefully we'll get the issues ironed out soon and a new version of
> >> m2eclipse-android-integration released.
>
> >> Regards...
>
> >> --
> >> Ricardo Gladwell <ricardo.gladw...@gmail.com>

Premier

unread,
Nov 26, 2010, 4:17:32 AM11/26/10
to Maven Android Developers
Are there news about this?

On 5 Nov, 09:11, Ricardo Gladwell <ricardo.gladw...@gmail.com> wrote:
> Will do my best, but hampered by poor documentation of the m2eclipse
> API, inexperience doing desktop development, and general lack of free
> time. Hopefully will get something done this weekend.
>
> --
> Ricardo Gladwell <ricardo.gladw...@gmail.com>http://www.google.com/profiles/ricardo.gladwell
> Twitter: @axonrg - MSN: axo...@gmail.com
>
> On 4 November 2010 19:44, Manfred Moser <manf...@mosabuam.com> wrote:
>
>
>
>
>
>
>
> > I think there are a LOT of users waiting for this Ricardo! It would be
> > awesome if you could get it done.
>
> >> Hi Sergio
>
> >> I'm currently working on an Eclipse problem that may resolve some of
> >> the issues that you're working on and simplify the development with
> >> maven-android-plugin in Eclipse:
>
> >>https://code.google.com/a/eclipselabs.org/p/m2eclipse-android-integra...
>
> >> Unfortunately, the code is not in a state for regular use, but I'm
> >> hoping to issue a new release in the next few weeks that should work.
> >> Please stay subscribed to this mailing list for updates.
>
> >> Regards...
>
> >> --
> >> Ricardo Gladwell <ricardo.gladw...@gmail.com>

Ricardo Gladwell

unread,
Nov 26, 2010, 5:26:18 AM11/26/10
to maven-androi...@googlegroups.com
Hopefully there will be a new release this weekend.

--
Ricardo Gladwell <ricardo....@gmail.com>

Reply all
Reply to author
Forward
0 new messages