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
groupId – a unique base name of the company or group that created the project. artifactId – a unique name of the project. version – a version of the project.
A good way to determine the granularity of the groupId is to use the project structure. That is, if the current project is a multimodule project, it should append a new identifier to the parent's groupId - e.g., org. apache. maven, org.
artifactId is the name of the jar without version. If you created it, then you can choose whatever name you want with lowercase letters and no strange symbols. If it's a third party jar, you have to take the name of the jar as it's distributed.
So ${project.name} refers to the name of the project, ${project. version} refers to the version of the project, ${project. build. finalName} refers to the final name of the file created when the built project is packaged, etc.
The .jar
s do not have an artifact id. You give them one while mvn install
ing.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With