简体   繁体   English

为Maven依赖安装自己的jar库

[英]Installing own jar library for Maven dependency

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). 这可能是愚蠢的问题,但我在这里还没有找到答案: https//github.com/mosabua/maven-android-sdk-deployer (也许我是盲人)。 I want to use this tool to install my library into sdk and then load it to <dependency> in my POM.xml . 我想使用此工具将我的库安装到sdk中,然后将其加载到我的POM.xml <dependency>中。 But I can't see any instructions how to do this. 但我看不到任何说明如何执行此操作。 My library is httpclientandroidlib-1.1.2.jar. 我的图书馆是httpclientandroidlib-1.1.2.jar。 Where should I put it and what command should I run to load it to sdk via sdk-deployer ? 我应该在哪里放置它,应该运行什么命令通过sdk-deployer将其加载到sdk?

I know I can use Maven Central , but they don't have the version I need. 我知道我可以使用Maven Central ,但是它们没有我需要的版本。

If I understand the question exactly you do not need the maven-android-sdk-deployer. 如果我完全理解问题,则不需要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 如果问题是您需要安装库才能使用它,则可以使用类似以下的方法将其添加到本地Maven存储库中

mvn install:install-file -Dfile=./android-support-v4.jar -DgroupId=com.google.android -DartifactId=support-v4 -Dversion=r12 -Dpackaging=jar mvn install:安装文件-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 这是我用于android-support-v4的内容,您需要使用httpclientandroidlib-1.1.2.jar的适当groupId等对其进行调整

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM