Installing own jar library for Maven dependency

2019-09-06 20:45发布

问题:

this may be the stupid question, but I haven't found the answer here : https://github.com/mosabua/maven-android-sdk-deployer (maybe I am blind). I want to use this tool to install my library into sdk and then load it to <dependency> in my POM.xml. But I can't see any instructions how to do this. My library is httpclientandroidlib-1.1.2.jar. Where should I put it and what command should I run to load it to sdk via sdk-deployer ?

I know I can use Maven Central, but they don't have the version I need.

回答1:

If I understand the question exactly you do not need the maven-android-sdk-deployer. if the issue is that you need to install the library so that you can use it you may add it to your local maven repo using something like this

mvn install:install-file -Dfile=./android-support-v4.jar -DgroupId=com.google.android -DartifactId=support-v4 -Dversion=r12 -Dpackaging=jar

from the dir where the jar is

this is what I used for android-support-v4, you need to tweak it with the proper groupId etc for the httpclientandroidlib-1.1.2.jar