APKLIB没有得到安装在Maven的回购 [英] APKLIB does not get installed in Maven Repo

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

问题描述

这一定是一个非常愚蠢的新手问题,但我已经花了我一整天试图找出什么是错的这个事情。

我正要包括依赖福尔摩斯动作扎入我的Andr​​oid Maven项目。该网站做了一个回购协议,以支持Maven的机器人安装。我知道,我应该只包含依赖,然后指定回购的POM里面,我已经成功地做​​到,但没有运气这样做只是没有为我工作。

这些都是依赖和资源库​​的标签我用

 <依赖>
        <的groupId> com.actionbarsherlock< /的groupId>
        < artifactId的>库< / artifactId的>
        <版> 3.5.1< /版本>
        <类型> apklib< /类型>
    < /依赖性>
 

 <库>
        < ID> jakewharton< / ID>
        &LT;网址&GT; HTTP://r.jakewharton.com/maven/release/< / URL&GT;
    &LT; /存储库&GT;
 

我根本不具有任何错误。只是,我不能看到月食我Package Explorer中的Maven依赖目录下的APKLIB。但最重要的,我不能用包/类的apklib下。

我缺少什么?

解决方案

这特殊类型apklib依赖只适用于Android的Maven的插件命令行控制台。将它作为你的主要项目的POM的依赖并不库项目自动导入到Eclipse,所以在Package Explorer中显示任何库项目。

简单地增加了apklib在POM依赖关系没有太大的帮助进行项目开发。作为apklib下包/类未引用/链接到您的主项目。它是从正规JAR依赖,在那里你只需添加JAR依赖到你的项目,并在你的主要项目启动导入/使用包/类不同。

您需要导入库项目到Eclipse的工作区,并与主体工程联系起来。正如你已经在使用Android系统的maven-plugin的,最直接的方式做,这是改变你的maven项目分成多模块项目,并添加库项目作为一个子模块 签出Android的Maven的插件样本这里

希望这有助于。

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的回购的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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