How to find out the group and artifacts of any external cans in a maven android project

I am working on a maven based Android project. I need to add all the jars files of the libs folder to the local maven repositories, because many banks are not available in the maven central repositories. For this, I will use the following commands. But my question is how to get the group identifier, artifact identifier from any external bank.
Suppose I have picasso.jar, in which case I don't know the version either.

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 eg jar 

Please help me.

Thanks at Advance

+7
source share
2 answers

.jar do not have an artifact identifier. You give them one while mvn install ing. For example, take picasso.jar 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, when used in your project, you need to add a dependency with this information.

+11
source

I created a script to help you create a pom.xml dependency tag if you have a folder full of jar files.

To detect this information, the script does the following:

  1. First he looks inside the can for META-INF / maven /
  2. then he tries to find the bank by the SHA1 checksum on search.maven.org
  3. then finally it puts a comment in the pom.xml file with information about the jar manifest, which will help you find the dependency yourself. Of course, you may not find a jar anywhere, and then you will have to place it in your own maven repository.

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

0
source

Source: https://habr.com/ru/post/973636/


All Articles