Dependency Omission on Eclipse Import

816 views
Skip to first unread message

Jake Wharton

unread,
Mar 22, 2011, 11:45:19 PM3/22/11
to maven-androi...@googlegroups.com
Perhaps this is a simple oversight on my part but eclipse seems to neglect adding one of the dependencies in a few modules to their respective project on import. The dependency itself is somewhat unique in that it is neither published on a repository nor part of the project itself. Rather, I have a custom python script which automatically clones a git repository, zip's a subfolder (to an .apklib), and injects the file into the local maven repo.

When building with the CLI the resolution succeeds. Upon importing the root pom.xml (and all of it's modules) as projects into Eclipse, however, this dependency was left out of the 'Maven Dependencies' dynamic folder.

The project is hosted publicly at https://github.com/JakeWharton/ActionBarSherlock/tree/dev for you can test directly (make sure you execute the dependencies.py first). The modules in question are all three sample projects.


Maven 2.2.1
Java 1.6.0_24
Eclipse 3.5.2 (Galileo)
ADT 10.0.1
m2eclipse 0.12.1
m2eclipse-android-integration 0.2.5

Ricardo Gladwell

unread,
Mar 23, 2011, 7:20:13 AM3/23/11
to maven-androi...@googlegroups.com
Hi Jake

On 23 March 2011 03:45, Jake Wharton <jakew...@gmail.com> wrote:
> When building with the CLI the resolution succeeds. Upon importing the root pom.xml (and
> all of it's modules) as projects into Eclipse, however, this dependency was left out of the
> 'Maven Dependencies' dynamic folder.

The current release of m2eclipse-android-integration (0.2.5) does not
support Android library projects which could be the issue. This is
coming in the new 0.3.0 alpha version which will released in time with
m2eclipse 0.13.0, but I haven't written any code to handle apklib
dependencies yet so this may not solve your problem.

Sounds like a new feature:

https://code.google.com/a/eclipselabs.org/p/m2eclipse-android-integration/issues/detail?id=44

Patches welcome :)

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

Jake Wharton

unread,
Mar 29, 2011, 12:18:45 PM3/29/11
to maven-androi...@googlegroups.com, Ricardo Gladwell
I glanced at the source and assume something will have to be added to AndroidDevelopmentToolsProjectConfigurator? Other than that I don't see anything really dealing with dependency management.

Can Eclipse even handle an .apklib dependency? Adding the .apklib of the missing dependency does not cure the problem because Eclipse does not know that the dependency is to be treated as an Android library.

Manfred Moser

unread,
Mar 29, 2011, 12:43:13 PM3/29/11
to maven-androi...@googlegroups.com, Ricardo Gladwell

I dont think the m2eclipse android integration project has added that yet,
but I am sure contributions are welcome ;-)

Ricardo Gladwell

unread,
Mar 29, 2011, 12:58:43 PM3/29/11
to man...@mosabuam.com, maven-androi...@googlegroups.com
Yes, as Manfred says, this is yet to be implemented, but is on the to-do list.

On 29 March 2011 17:43, Manfred Moser <man...@mosabuam.com> wrote:
>> I glanced at the source and assume something will have to be added to
>> AndroidDevelopmentToolsProjectConfigurator? Other than that I don't see
>> anything really dealing with dependency management.

Yes, the configureClasspath or configureRawClasspath methods will need
to be modified to add apklib dependencies to the 'Maven Dependencies'
dynamic classpath.

>> Can Eclipse even handle an .apklib dependency? Adding the .apklib of the
>> missing dependency does not cure the problem because Eclipse does not know
>> that the dependency is to be treated as an Android library.

Yes, we will need to write code that tells the ADT that a apklib
dependency JAR is an Android Library. This assumes that the ADT
supports Android Library as JARs, and doesn't require Android Library
projects to be in the same workspace.

I suppose if the ADT doesn't support this we could unzip the JAR
archive and add it to the workspace automatically.

Further discussion about this change is better carried out on the
ticket I raised:

https://code.google.com/a/eclipselabs.org/p/m2eclipse-android-integration/issues/detail?id=44

Regards...

Reply all
Reply to author
Forward
0 new messages