8

This must be a very stupid newbie question, but I have spent my whole day trying to figure out what is wrong with this thing.

I was about to include a dependency on Sherlock Action bar into my Android-Maven project. The site made a repo to support maven-android setup. I know that I was supposed to just include the dependency, then specify the repo inside the pom, that I have managed to do, but to no luck did this just not work for me.

these are the dependency and repository tags I used

    <dependency>
        <groupId>com.actionbarsherlock</groupId>
        <artifactId>library</artifactId>
        <version>3.5.1</version>
        <type>apklib</type>
    </dependency>

and this

    <repository>
        <id>jakewharton</id>
        <url>http://r.jakewharton.com/maven/release/</url>
    </repository>

i don't have any errors at all. It's just that I can't see the APKLIB under the maven dependencies directory on my package explorer at eclipse. But most importantly, I can't use the packages/classes under the apklib.

Am I missing anything?

mahkie
  • 232
  • 2
  • 13
  • unfortunately i didn't. i gave up. i know. but i was in a hurry. i was chasing after a deadline. i had to move on and create a actionbar-looking view for my self. between the actionbar sherlock and maven. i had to give up the actionbar. so if anybody out there who encountered the problem and has triumphed over it, please, help us. ^^ . if i get more time i will get back on this. i'll get back on u efi – mahkie Mar 15 '12 at 04:59

1 Answers1

12

This special type of apklib dependency only works in android-maven-plugin from command line console. adding it as a dependency in your main project's POM does not automatically import the library project into your Eclipse, so no library project shown in Package Explorer.

Simply adding the apklib as a dependency in pom doesn't help much for project development. as packages/classes under the apklib is not referenced/linked to your main project. it is different from the regular jar dependency, where you simply add jar dependency into your project and start import/use packages/classes in your main project.

Your need import the library project into your Eclipse workspace, and link it with your main project. As you already use android-maven-plugin, the most straight forward way to do this is change your maven project into multi-module project and add the library project as a sub-module check out the LibraryProjects from android-maven-plugin sample here

Hope this help.

yorkw
  • 40,926
  • 10
  • 117
  • 130