APKLIB 未安装在 Maven Repo 中 [英] APKLIB does not get installed in Maven Repo

查看:26
本文介绍了APKLIB 未安装在 Maven Repo 中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这一定是一个非常愚蠢的新手问题,但我花了一整天的时间试图弄清楚这件事有什么问题.

我正准备在我的 Android-Maven 项目中包含对 Sherlock Action 栏的依赖.该站点制作了一个 repo 来支持 maven-android 设置.我知道我应该只包含依赖项,然后在 pom 中指定 repo,我已经设法做到了,但不幸的是,这对我不起作用.

这些是我使用的依赖和存储库标签

 <依赖><groupId>com.actionbarsherlock</groupId><artifactId>库</artifactId><version>3.5.1</version><type>apklib</type></依赖>

还有这个

 <id>杰克沃顿</id><url>http://r.jakewharton.com/maven/release/</url></repository>

我根本没有任何错误.只是我在eclipse的包浏览器上看不到maven依赖目录下的APKLIB.但最重要的是,我无法使用 apklib 下的包/类.

我错过了什么吗?

解决方案

这种特殊类型的 apklib 依赖项仅适用于来自命令行控制台的 android-maven-plugin.将其作为依赖项添加到主项目的 POM 中不会自动将库项目导入 Eclipse,因此包资源管理器中不会显示库项目.

简单地在 pom 中添加 apklib 作为依赖对项目开发没有多大帮助.因为 apklib 下的包/类未引用/链接到您的主项目.它与常规的 jar 依赖不同,在常规 jar 依赖中,您只需将 jar 依赖添加到您的项目中,然后在主项目中开始导入/使用包/类.

您需要将库项目导入您的 Eclipse 工作区,并将其与您的主项目链接.由于您已经使用了 android-maven-plugin,因此最直接的方法是将您的 Maven 项目更改为多模块项目并将库项目添加为子模块在 此处<查看 android-maven-plugin 示例中的 LibraryProjects/p>

希望对您有所帮助.

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?

解决方案

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.

这篇关于APKLIB 未安装在 Maven Repo 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆