如何知道Maven Android项目中任何外部罐子的groupid和artifactid [英] How to know groupid and artifactid of any external jars in maven android project

查看:318
本文介绍了如何知道Maven Android项目中任何外部罐子的groupid和artifactid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在基于Maven的android项目上工作.我需要将libs文件夹的所有jar文件添加到Maven本地存储库中,因为许多jar无法在Maven中央存储库中使用. 为此,我将使用以下命令.但是我的问题是如何从任何外部jar获取group-id,artifact-id.
假设我在这种情况下没有picasso.jar 也知道版本.

I am working on maven based android project. I need to add all jars files of libs folder into maven local repositories because many jars are not available into maven central repositories. For this i am going to use following commands.But my question is how to get group-id,artifact-id from any external jar.
Suppose i am having picasso.jar in this case i don't know version too.

 mvn install:install-file
-Dfile=<path-to-file>
-DgroupId=<group-id>
-DartifactId=<artifact-id>
-Dversion=<version>
-Dpackaging=<packaging>
-DgeneratePom=true

Where:<path-to-file>  the path to the file to load
   <group-id>      the group that the file should be registered under
   <artifact-id>   the artifact name for the file
   <version>       the version of the file
   <packaging>     the packaging of the file e.g. jar

请帮助我.

预先感谢

推荐答案

.jar没有人为因素ID.您在mvn install ing期间给他们一个. 例如,让我们以您的案例为例:

The .jars do not have an artifact id. You give them one while mvn installing. For example let's take picasso.jar of your case:

mvn install:install-file
-Dfile=<path-to-your-picasso.jar>
-DgroupId='com.square'
-DartifactId='picasso'
-Dversion=<version-given-by-you-(better using original picasso.jar version)>
-Dpackaging=<packaging>
-DgeneratePom=true

然后在您的项目中使用时,您需要使用此信息添加依赖项.

Then while using in your project, you need to add the dependency with this information.

这篇关于如何知道Maven Android项目中任何外部罐子的groupid和artifactid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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