Maven的,ActionBarSherlock v4和Roboguice V2 - 如何得到它来构建? [英] Maven, ActionBarSherlock v4 and Roboguice v2 - How do I get it to build?
问题描述
我试图建立一个项目,同时使用ActionBarSherlock v4和Roboguice V2
(我喜欢beeing最前沿的:))。
I'm trying to build a project to uses both ActionBarSherlock v4 and Roboguice v2 (I like beeing of the bleeding edge :) ).
的问题是,ABS采用稍加修改的兼容性
库,这需要Roboguice。我把它通过Eclipse的下工作正常
加入 actionbarsherlock-插件-compat的-LIB-4.0.0-SNAPSHOT
, roboguice-2.0b3
和 ActionBarSherlock
项目。
The problem is that ABS uses a slightly modified compatibility
library, that Roboguice needs. I got it working fine under Eclipse by
adding actionbarsherlock-plugin-compat-lib-4.0.0-SNAPSHOT
,
roboguice-2.0b3
and the ActionBarSherlock
project.
现在的问题是,Maven的下,我需要包括以下
因为Roboguice的依赖性:
Now the problem is that under Maven, I need to include the following dependency because of Roboguice:
<dependency>
<groupId>android</groupId>
<artifactId>compatibility-v4</artifactId>
<version>r3-SNAPSHOT</version>
</dependency>
和我需要添加以下依赖于ABS:
And I need to add the following dependency for ABS:
<dependency>
<groupId>com.actionbarsherlock</groupId>
<artifactId>plugin-compat-lib</artifactId>
<version>4.0.0-SNAPSHOT</version>
</dependency>
当我做了一个MVN全新安装,出现以下错误:
When I do a "mvn clean install", the following error occurs:
[INFO] java.lang.IllegalArgumentException: already added: Landroid/
support/v4/app/ActivityCompatHoneycomb;
由于 ActivityCompatHoneycomb
在这两个依赖present。
because ActivityCompatHoneycomb
is present in both dependency.
有什么建议?
完整的源$ C $ c和建设项目,请访问:
https://github.com/thierryd/adg-android
The full source code and build project is available at: https://github.com/thierryd/adg-android
推荐答案
感谢@dma_k,它的工作,加入下面的排斥标签,并通过删除兼容性-V4依赖:
Thanks to @dma_k, it worked by adding the following "exclusion" tag and by removing the "compatibility-v4" dependency:
<dependency>
<groupId>org.roboguice</groupId>
<artifactId>roboguice</artifactId>
<version>2.0-SNAPSHOT</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>android.support</groupId>
<artifactId>compatibility-v4</artifactId>
</exclusion>
</exclusions>
</dependency>
这篇关于Maven的,ActionBarSherlock v4和Roboguice V2 - 如何得到它来构建?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!