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
Please help me.
Thanks in Advance
.jars do not have an artifact id. You give them one while
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.
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:
- It first looks inside the jar for META-INF/maven/
- then it tries to search for the jar by SHA1 checksum on search.maven.org
- 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/