Maven、ActionBarSherlock v4 和 Roboguice v2 - 如何构建它?
我正在尝试构建一个项目来同时使用 ActionBarSherlock v4 和 Roboguice v2 (我喜欢走在最前沿:))。
问题是ABS使用了稍微修改的兼容性 Roboguice 需要的库。我让它在 Eclipse 下工作得很好 添加actionbarsherlock-plugin-compat-lib-4.0.0-SNAPSHOT
, roboguice-2.0b3
和 ActionBarSherlock
项目。
现在的问题是,在Maven下,我需要包含以下内容 由于 Roboguice 的依赖关系:
<dependency>
<groupId>android</groupId>
<artifactId>compatibility-v4</artifactId>
<version>r3-SNAPSHOT</version>
</dependency>
我需要为 ABS 添加以下依赖关系:
<dependency>
<groupId>com.actionbarsherlock</groupId>
<artifactId>plugin-compat-lib</artifactId>
<version>4.0.0-SNAPSHOT</version>
</dependency>
当我执行“mvn clean install”时,会发生以下错误:
[INFO] java.lang.IllegalArgumentException: already added: Landroid/
support/v4/app/ActivityCompatHoneycomb;
因为 ActivityCompatHoneycomb
存在于两个依赖关系中。
有什么建议吗?
完整的源代码和构建项目可在以下位置获取: https://github.com/thierryd/adg-android
I'm trying to build a project to uses both ActionBarSherlock v4 and Roboguice v2
(I like beeing of the bleeding edge :) ).
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.
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>
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>
When I do a "mvn clean install", the following error occurs:
[INFO] java.lang.IllegalArgumentException: already added: Landroid/
support/v4/app/ActivityCompatHoneycomb;
because ActivityCompatHoneycomb
is present in both dependency.
Any suggestions?
The full source code and build project is available at:
https://github.com/thierryd/adg-android
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
感谢@dma_k,它通过添加以下“排除”标签并删除“compatibility-v4”依赖项来工作:
Thanks to @dma_k, it worked by adding the following "exclusion" tag and by removing the "compatibility-v4" dependency: