How can I add an apklib dependency to your android maven project?

☆樱花仙子☆ 提交于 2019-12-11 09:33:57

问题


I have an android project which I am developing on eclipse and building with maven. I wanted to include a lib (apklib) in it, and similarly to other includes, I have tried appending the dependency to my pom in the following way:

<dependency>
    <groupId>groupID.name</groupId>
    <artifactId>artifact.name</artifactId>
    <version>version</version>
</dependency>

However, when trying to build it either from m2eclipse or from maven on the console, I would get an error

(Failed to execute goal on project projectName: Could not resolve dependencies for project project Failure to find apklib in repo was cached in the local repository, resolution will not be reattempted until the update interval of repo has elapsed or updates are forced)

saying that this dependency could not be found even if I can see the dependency in my .m2 directory


回答1:


The solution was quite simple, but since I found it through an example trying to demonstrate something else, rather than a Q&A (and I did not find it easily in the maven-android-plugin project,) I decided to share it here with the hope it can help someone.

The solution was just to set my dependency type to apklib in this way:

<dependency>
    <groupId>groupID.name</groupId>
    <artifactId>artifact.name</artifactId>
    <version>version</version>
    <type>apklib</type>
</dependency>


来源:https://stackoverflow.com/questions/14354907/how-can-i-add-an-apklib-dependency-to-your-android-maven-project

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