Home » Android » How to know groupid and artifactid of any external jars in maven android project

How to know groupid and artifactid of any external jars in maven android project

Posted by: admin June 15, 2020 Leave a comment


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

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

Please help me.

Thanks in Advance

How to&Answers:

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
-Dversion=<version-given-by-you-(better using original picasso.jar version)>

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


I’ve created a script that helps you build the pom.xml dependencies tag if you have a folder full of jars.

To discover this information the script does the following:

  1. It first looks inside the jar for META-INF/maven/
  2. then it tries to search for the jar by SHA1 checksum on search.maven.org
  3. then finally it puts a comment in pom.xml with information about the jar manifest to help you in locating the dependency yourself. Of course you may not find the jar anywhere and then you’ll have to host it in your own private maven repository.

You can get it here: https://github.com/sjbotha/make-pom/