ActionBarSherlock + maven + eclipse: dependency not found in workspace

心不动则不痛 提交于 2019-12-01 02:22:45

As of Android 0.4.2 you now need to mavenise the Android library projects in your Eclipse workspace for m2e-android to successfully detect them. The POM for ActionBarSherlock can be found here:

https://github.com/JakeWharton/ActionBarSherlock/blob/master/library/pom.xml#

Note: m2e-android is beta software and so changes that might affect functionality can occur between releases.

For those who don't know what "MAVENIZED" means it is convert a simple project to be a Maven Project.

In Eclipse, right click in your project, Configure -> Convert to Maven Project

you can include the actionbarsherlock dependency as jar file only when using eclipse via profiles

<profile>
  <id>m2e</id>
  <activation>
    <property><name>m2e.version</name></property>
   </activation>
   <dependencies>
    <dependency>
      <groupId>com.actionbarsherlock</groupId>
      <artifactId>actionbarsherlock</artifactId>
      <version>${abs.version}</version>
      <type>jar</type>
    </dependency>
  </dependencies>
</profile> 

and don't need to include the entire actionbarsherlock as project in eclipse

Add this to your parent pom.xml file as a dependency:

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

And the following lines to your project pom.xml:

<dependency>
    <groupId>com.actionbarsherlock</groupId>
    <artifactId>actionbarsherlock</artifactId>
    <version>4.2.0</version>
</dependency>

I've wrote detailed tutorial about mvn + eclipse + action bar sherlock integration http://v.zasadnyy.com/blog/abs-maven-eclipse-integration/

Hope it will be helpful.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!