Domanda

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

È stato utile?

Soluzione

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>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top